See the following section in the infocenter:
www.ibm.com/software/webservers/appserv/doc/v40/ae/infocenter/
4.2.1.3.7: Serving all files from application servers
Files are served on a per-web module, not a per-appserver basis. To
enable file serving, you can either:
1. Click the File Serving Enabled checkbox in the IBM extensions panel of
the Application Assembly Tool (AAT),
or
2. Change the fileServingEnabled flag from false to true in the
ibm-web-ext.xmi file.
The ibm-web-ext.xmi file is located in the WEB-INF directory of the
installed Web module.
In addition, if using the context root of "/" you must also do 1 of the
following:
Either:
1. Open the ear file in the AAT
A) Add the following Web Component (Servlet)
Component Name: FileServingEnabler
Class Name: com.ibm.servlet.engine.webapp.SimpleFileServlet
Select load on startup
B) Right click on Servlet Mapping and select New
URL Pattern: /
Servlet: FileServingEnabler
C) Save and deploy the ear file.
D) Regen the plugin for the changes to take effect.
OR for more advanced users:
2. To enable the serving of static files from the root context, add the
statements below to the default application's web.xml file. Adding the
statements means you do not need to update the plugin-cfg.xml file
manually after each regeneration of the plugin-cfg.xml file. Regen the
plugin, and restart the webserver after the file is modified.
In the Servlet ID section:
<servlet id="Servlet_SFS">
<servlet-name>FileServingEnabler</servlet-name>
<servlet-class>com.ibm.servlet.engine.webapp.SimpleFileServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
In the URL Mapping Section:
<servlet-mapping id="ServletMapping_SFS">
<servlet-name>FileServingEnabler</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Make sure the id's are unique in file.
Note: The additional steps should not be required for WAS 4.0.4.
|