This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Deployment Descriptor web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Deployment Descriptor web.xml" Watch "Deployment Descriptor web.xml" New topic
Author

Deployment Descriptor web.xml

Shailaja Tankala
Greenhorn

Joined: Jan 31, 2005
Posts: 5
Hi

I have two filters to process a servletrequest called as FirstFilter and SecondFilter.
The request should pass through FirstFilter and than SecondFilter before it can be processed by the encompassing component.
How can I specify that the request should pass through FirstFilter and than SecondFilter in the deployment descriptor file web.xml.


Thanks In advance
Sharmila
Daniel Rhoades
Ranch Hand

Joined: Jun 30, 2004
Posts: 186
Here you go:

<filter>
<filter-name>FirstFilter</filter-name>
<filter-class>filters.FirstFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>FirstFilter</filter-name>
<servlet-name>someservlet</servlet-name>
</filter-mapping>

<filter>
<filter-name>SecondFilter</filter-name>
<filter-class>filters.SecondFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SecondFilter</filter-name>
<servlet-name>someservlet</servlet-name>
</filter-mapping>

The order in which your filters are used is the same as the order in the DD


Drinking more tea is the key...
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Deployment Descriptor web.xml
 
It's not a secret anymore!