Servlets and Filters
From Resin 3.0
This article requires cleanup and may refer to a legacy version of Resin.
Please visit http://www.caucho.com/documentation/ for the most up-to-date documentation. |
Corresponding Resin documentation is http://www.caucho.com/resin-3.0/servlet.
Contents |
Servlet Library
- FileServlet - handles normal files
- JspServlet - handles JSP files
- FastCGIServlet - handles backend fast cgi
- HttpProxyServlet - proxies HTTP requests to a backend
- SSIServlet - provides basic server-side include functionality
Filter Library
- TransactionFilter - execute the request inside a transaction
- XsltFilter - filters the response with an XSLT stylesheet
- ThrottleFilter - limits the number of requests from a client
- GzipFilter - (Pro) compresses the output of a servlet or JSP
Using a servlet as the welcome page
- Create a dummy index.htm file.
- Add index.htm to the <welcome-file-list> element of your web.xml.
- Create a <servlet-mapping>element for your welcome servlet that maps to /index.htm.
- Deploy the application, fire up your favourite browser, and enjoy!
The following is an example web.xml file:
<web-app> <welcome-file-list> <welcome-file>index.jsp</welcome-file> <welcome-file>index.xtp</welcome-file> <welcome-file>index.htm</welcome-file> </welcome-file-list> <servlet> <servlet-name>welcome</servlet-name> <servlet-class>your.welcome.Servlet</servlet-class> </servlet> <servlet-mapping> <url-pattern>/index.htm</servlet-class> <servlet-name>welcome</servlet-class> </servlet-mapping> </web-app>
Gzip filter
This is some addendum to what is available at http://www.caucho.com/resin-3.0/servlet/filter-library.xtp#GzipFilter.
- the correct class name is com.caucho.filters.GzipFilter as used in the example configuration, not the javadoc reference on the line afterward
- this filter is only available in the Pro version.
Also the reference to the GzipFilter on http://www.caucho.com/resin-3.0/features/overview.xtp#gzip has a bad link for the documentation and should be linked to the link above.