mihir_amreli
asked on
How to get resource from WEB-INF
I want an image to load in browser from web-inf.
Directly from web inf is not possible.
User servlet.
http://www.exampledepot.com/egs/javax.servlet/GetImage.html
User servlet.
http://www.exampledepot.com/egs/javax.servlet/GetImage.html
WEB-INF is a special place the browser has no access to.
Use a servlet streaming the resource as
Thread.currentThread.getCo ntextClass Loader().g etResource AsStream ("WEB-INF/someFile.jpg)
Use a servlet streaming the resource as
Thread.currentThread.getCo
ASKER
As per your response
Directly from web inf is not possible.
User servlet.
http://www.exampledepot.com/egs/javax.servlet/GetImage.html
I am able to load image in browser.
I am also enable to download .doc file
Thank you.
but not .docx because
getServletContext().getMim eType(file name) return null for .docx file.
Please Help.
Directly from web inf is not possible.
User servlet.
http://www.exampledepot.com/egs/javax.servlet/GetImage.html
I am able to load image in browser.
I am also enable to download .doc file
Thank you.
but not .docx because
getServletContext().getMim
Please Help.
ASKER
I got content type using getServletContext().getMim eType(file Name);
but I am getting "MIME-TYPE" null for the file which has extension is .docx
with .doc i am getting application/msword "MIME-TYPE".
but I am getting "MIME-TYPE" null for the file which has extension is .docx
with .doc i am getting application/msword "MIME-TYPE".
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Problem Solved.
http://<ipaddress or host name>/<<applicationName>>/