Professional Java Servlets 2.3
| < Free Open Study > |
|
We saw in this chapter how filters can be used to add functionality such as auditing, logging, authentication, transformation, compression, and encryption to our applications at deployment time. Such functionality can be easily added and removed as business requirements change.
Filters can be used without having to touch existing code. Filter definitions and filter mapping within the deployment descriptor are used to indicate to the container how filters should be chained together and which web resource the filters should apply to. Multiple instances of the same underlying filter can even be configured within the deployment descriptor together with different initialization parameters. The container manages the lifetime of a filter, and will create and destroy instances of the filter as specified in the deployment descriptor.
To complete the chapter, we built two filters: a simple logging filter, and a transformation filter. The transformation filter allowed the same underlying service logic to service a variety of different clients Finally, we saw how these two filters could be chained together in order to combine their functionality.
In the next chapter we're going to look at how we can harness the power of servlets with the flexibility and ease of use of a markup language - by using JavaServer Pages
A |
---|
Adaptor architectural pattern
auditing filters, 8 authentication filters, 9 authorization filters, 9 |
B |
---|
browsers, detecting type
buffers
|
C |
---|
chaining filters
classes
components
compression filters, 8 content substitution filters
|
D |
---|
decryption filters, 8 deployment descriptor
destroy() method
doFilter() method
|
E |
---|
elements
encryption filters, 8 |
F |
---|
filter> element
filterChain object
filter-class> element
filterConfig object
filter-mapping> element
filter-name> element
filters
filters, configuring, 6
filters, examples/types
filters, uses, 4, 8
|
G |
---|
getInitParameter() method
|
H |
---|
HTML (HyperText Markup Language)
|
I |
---|
init() method
init-param> element
interfaces
|
J |
---|
javax.servlet.Filter interface
|
L |
---|
lifecycle of a filter, 5 log file
logging filter example
logging filters, 8
|
M |
---|
methods
|
P |
---|
param-name> element
param-value> element
|
R |
---|
request transformation see filters. response transformation see filters. |
S |
---|
servlet> element
servlet-class> element
ServletException object
servlet-name> element
|
T |
---|
transformation filters, 9 |
U |
---|
url-pattern> element
USER-AGENT header
|
W |
---|
web services
web-app> element
wrapper class
|
X |
---|
XML (eXtensible Markup Language)
XSLT parser
XSLT transformation filter example, 13
xsltFactory object
xsltTemplates object
|
| < Free Open Study > |
|