Hi,
I'm using WLS 8.1 with SP2 on Windows environment.
I have created a new Web application using weblogic.servlet.FileServlet class. Here're my web.xml and weblogic.xml setting
============================
web.xml
============================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "<web-app>
<servlet>
<servlet-name>pbhFileServer</servlet-name>
<servlet-class>weblogic.servlet.FileServlet</servlet-class>
<init-param>
<param-name>docHome</param-name>
<param-value>D:\appl\myFiles</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>pbhFileServer</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
============================
weblogic.xml
============================
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "
<weblogic-web-app>
<jsp-descriptor>
<jsp-param>
<param-name>verbose</param-name>
<param-value>false</param-value>
</jsp-param>
</jsp-descriptor>
<context-root>/or</context-root>
</weblogic-web-app>
I archived them into a WAR file and successfully deployed it in WLS Runtime console.
I can request a JSP from the newly created Web Application context, ie:
But, I can't view any static files such as .doc, jpg, gif, etc in D:\appl\myFiles directory which is mapped to the servlet docHome value. Here's the requested URL
The file test.doc is in the D:\appl\myFiles directory.
The error that I got is 404.
Do you know what I'm missing?
Thanks,
Tuan
I'm using WLS 8.1 with SP2 on Windows environment.
I have created a new Web application using weblogic.servlet.FileServlet class. Here're my web.xml and weblogic.xml setting
============================
web.xml
============================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "<web-app>
<servlet>
<servlet-name>pbhFileServer</servlet-name>
<servlet-class>weblogic.servlet.FileServlet</servlet-class>
<init-param>
<param-name>docHome</param-name>
<param-value>D:\appl\myFiles</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>pbhFileServer</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
============================
weblogic.xml
============================
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "
<weblogic-web-app>
<jsp-descriptor>
<jsp-param>
<param-name>verbose</param-name>
<param-value>false</param-value>
</jsp-param>
</jsp-descriptor>
<context-root>/or</context-root>
</weblogic-web-app>
I archived them into a WAR file and successfully deployed it in WLS Runtime console.
I can request a JSP from the newly created Web Application context, ie:
But, I can't view any static files such as .doc, jpg, gif, etc in D:\appl\myFiles directory which is mapped to the servlet docHome value. Here's the requested URL
The file test.doc is in the D:\appl\myFiles directory.
The error that I got is 404.
Do you know what I'm missing?
Thanks,
Tuan