|
WebLogic Server 7.0 Code Examples, BEA Systems, Inc. | |||||
See:
Description
| Class Summary | |
| CustomOutputStream | CustomOutputStream is a user defined custom OutputStream that substitutes the replace value for the key value in all output. |
| MyResponseWrapper | MyResponseWrapper is a class that extends the HttpServletResponseWrapper for to modify the HttpServlet Response. |
| SubstFilter | SubstFilter is a servlet filter that sets init parameters from the web.xml file, and passes them on to the wrapper to modify the servlet response. |
This example demonstrates how to write Servlet Wrappers.
MyResponseWrapper is a servlet wrapper that modifies the response of a web application. This example defines a CustomOutputStream which overrides the normal output stream. This OutputStream replaces the value of the servlet parameter "keytext" with the value of "replaceText". These are passed as init-parameters by the web.xml file, so the user must edit the web.xml file to change the original output to be replaced or the output with which to replace it.
See:
Description
| Additional Resources for examples.servlets.wrapper | |
| build.xml | The Ant build script that assembles and deploys the application. |
| web.xml | Web Application deployment descriptor. The descriptor configures the filter on the application and passes in the init-parameters that the customOutputStream uses for substitution. |
The wrapper webapp uses the MyResponseWrapper class which overrides the HttpServletResponseWrapper class to provide for a custom response output.
Perform the following steps in order to build and run the example:
prompt> ant
http://hostname:port/wrapperWebAppwhere:
|
Documentation is available at http://e-docs.bea.com/wls/docs70 |
|||||