Servlets and Filters
Resin 3.0

Orientation
Features
Installation
Configuration
Web Applications
JSP
Servlets and Filters
Portlets
Databases
Admin (JMX)
Amber
Security
XML and XSLT
XTP
Resources
Performance
Protocols
Third-party
Troubleshooting/FAQ

Servlets
Servlet Lib
run-at
Filters
Filter Lib
Tutorials
FAQ
JSP
Resin 3.0
Servlets

Servlets

Servlets are Java classes which service HTTP requests. The only requirement for writing a servlet is that it implements the javax.servlet.Servlet interface.

Servlet Library

Resin provides a set of convenient servlets in the com.caucho.servlets.* package.

ErrorStatusServlet

Sends an HTTP error code and optionally an error message back to the client.

LoadBalanceServlet

Configures a front-end Resin instance to load-balance requests to backend Resin instances.

CGIServlet

Implements CGI calls.

FastCGIServlet

Implements the FastCGI protocol.

WebDAV

WebDAV, web-based distributed authoring and versioning, is a set of extensions to the HTTP protocol that is a convenient replacement for FTP when developing web sites.

run-at: Periodic Services

Some web applications need a task to be run at regular intervals, e.g. once an hour or once a day. For example, a search application might want to spider the web site every day to automatically pick up any new pages. Syndication applications might poll their news sites every hour to check for updates.

Filters
Filter Library

Resin provides a set of convenient filters in the com.caucho.filters.* package.

GzipFilter

The GzipFilter compresses the output of pages for browsers which understand compression, and leaves the output unchanged if the browser does not support compression.

XsltFilter

The XsltFilter transforms the response using xslt.

TransactionFilter

The TransactionFilter wraps the request in a UserTransaction and commits the transaction when the servlet completes.

ExpiresFilter

The ExpiresFilter sets the Expires cache control header, allowing servlet output and jsp results to be cached for a short time.

AnonymousExpiresFilter

The AnonymousExpiresFilter caches the response for anonymous users.

RewriteFilter

The RewriteFilter rewrites and forwards URLs matching a regular expression.

ThrottleFilter

A new standard ThrottleFilter has been added.

Servlet and Filter Tutorials
A Hello, World Servlet

A trivial "hello, world" servlet

Bean-style servlet

Resin allows servlets to be configured with bean-style setters.

Sub-bean servlet init

Servlet initializers using the bean-style initialization can set sub-beans.

Filter Templates

This tutorial provides a good source for cut-and-paste development of your own Filters.

Servlets and Filters FAQ

Can I put a filter in resin.conf that get's executed before the filters in web.xml?

I would like to have a filter in resin.conf that always gets executed first in the filter chain to provide stats about the URL's that are called and the response time.


JSP
Resin 3.0
Servlets
Copyright © 1998-2003 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark, and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc.