Customizing SimpleFileServlet
 Technote (troubleshooting)
 
Problem(Abstract)
Workaround for problems experienced while disabling the file serving servlet, SimpleFileServlet.
 
Cause
If file serving is enabled for a Web application, all the requests from the Web server are routed to the WebSphere® Application Server that matches the context root of the Web application.

If file serving is disabled, there is a problem with static includes. To overcome this problem, configure SimpleFileServlet to serve appropriate file extensions.

 
Resolving the problem
To avoid this problem:
  1. Change all of the file extensions that you want served by SimpleFileServlet, to .jspinc (or any other unique extension).

  2. If applicable, modify all includes with the file extension you specified in Step 1.

  3. Open the EAR or WAR file in the Rational® Application Developer, WebSphere Studio Application Developer, Application Assembly Tool (AAT), Application Server Toolkit (ASTK), or a similar tool.
  1. Verify that file serving is disabled in IBM® Extensions.
  2. Add the following Web component (Servlet):

    For V4:
    Component Name: FileServingEnabler
    Class Name: com.ibm.servlet.engine.webapp.SimpleFileServlet

    For V5 and V6:
    Component Name: FileServingEnabler
    Class Name: com.ibm.ws.webcontainer.servlet.SimpleFileServlet
  3. Select load on startup.
  4. Add the following new servlet and URL mapping:

    URL Pattern: *.jspinc
    Servlet: FileServingEnabler
  5. Save and deploy the EAR or WAR file.
  6. Regenerate the plug-in for the changes to take effect.

Now all the static content is served by the Web server, except the .jspinc files.
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Servlet Engine/Web Container
Operating system(s): Windows
Software version: 6.0
Software edition:
Reference #: 1116838
IBM Group: Software Group
Modified date: Mar 31, 2006