Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't view files (doc, jpg, etc) with a newly created Web app

Status
Not open for further replies.

tuanster

IS-IT--Management
Sep 29, 2004
2
0
0
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top