|
Problem |
Users of WebSphere® Application Server for
z/OS® Version 4.01 want to be able to cache static files for a Web
application into the dynamic cache. |
|
|
|
Solution |
Use a copy of the WebSphere Application Server for
distributed platforms V4.0 or higher AAT for Distributed Platforms to
enable caching of static content for a Web application into the dynamic
cache. Then use the WebSphere Application Server V4.0.1 for z/OS AAT tool
to generate the deployment code for this Web application.
To enable caching of static content:
1. Define an instance of SimpleFileServlet as a Web component:
- Open the EAR file, and expand Web Modules.
- Click on a Web module which has static files.
- Under the IBM® Extensions tab, select File
Serving Enabled if it is not already checked.
- Expand the entries under Web Module.
- Under Web Components, define an instance of the file serving
servlet:
- Right click on Web Components and select New.
- Under the General tab, specify the following information:
Component Name: file
Component Description: File Serving Servlet
Component Type: Servlet
Class: com.ibm.servlet.engine.webapp.SimpleFileServlet
2. Click OK when done.
3. Define a servlet mapping for file:
- Right click on Servlet Mapping, and select New.
- Specify the following information:
URL: /
Servlet: file
4. Click OK when done.
5. Define a caching policy for the SimpleFileServlet instance:
- Expand the entries under Assembly Property Extensions.
- Right click on Servlet Caching Configuration, select
New.
- Define a caching group, for example, "staticfiles."
- Specify a priority.
- Specify a timeout value (for example, 300 for 300 seconds).
- Click Add for Servlets and JSPs.
- Click file, for the file serving servlet.
- Under the ID Generation tab, select Use URIs for Cache ID
building.
- Optionally, you can use the Advanced tab to specify caching to
an External Cache.
6. Click OK when done. 7. Define caching policies for other
servlets/JSPs as desired:
- Expand the entries under Assembly Property Extensions.
- Right click on Servlet Caching Configuration, select
New.
- Define a new caching group, for example, "servlets."
- Specify a priority.
- Specify a timeout value (0 for no timeout).
- Click Add for Servlets and Java™ Server Pages
(JSP).
- Select the servlet or JSP you want to cache.
- Under the ID Generation tab, specify the items to be used in
cache-ids. For more information, see WebSphere Application
Server Version V4.0.1 for z/OS and OS/390 Assembling J2EE
Applications. This publication is available at URL: http://www.ibm.com/software/webservers/appserv/zos_os390/library/
- Optionally, you can use the Advanced tab to specify caching to
an External Cache.
8. Click OK when done.
9. Repeat these steps for any other servlets or JSPs that you want to be
cached. 10. Save the archive file and generate the deployment code. |
|
|
|
|
|
|
|