wood burning stoves 2.0*
The moose likes Struts and the fly likes url pattern in servlet filter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "url pattern in servlet filter" Watch "url pattern in servlet filter" New topic
Author

url pattern in servlet filter

muthu bharathi
Ranch Hand

Joined: Dec 10, 2008
Posts: 97
Hi,

How to give the url pattern in filters in web.xml

My web.xml is like the following

<filter>
<filter-name>TokenGuard</filter-name>
<filter-class>com.app.core.token.TokenGuard</filter-class>
</filter>
<filter-mapping>
<filter-name>TokenGuard</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>

but it doesn't work... may i know the above url-pattern is correct or wrong...
or
how can we declare a filter to operate on more than one url pattern

if i give the url pattern like like <url-pattern>*.jsp</url-pattern> it works fine....

please help meeeee..


--
With Regards,
M. Bharathi

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Sounds like a servlet/JEE issue, not Struts.
muthu bharathi
Ranch Hand

Joined: Dec 10, 2008
Posts: 97
Hi,

if i give the url-pattern like the following.... the code works fine

<filter-mapping>
<filter-name>TokenGuard</filter-name>
<url-pattern>/RetailBank/*</url-pattern>
</filter-mapping>

if i give the url-pattern like the following.... the code doesnt work

<filter-mapping>
<filter-name>TokenGuard</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>

But i wants to know reason or what is the equivalent of *.do with specific reason.

Please clear me as soon as possible

Advance Thanks

--
With Regards,
M. Bharathi
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I believe you've misunderstood me--this isn't a Struts question, it's a servlet/JEE question.

Filter mapping doesn't really have anything to do with Struts.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: url pattern in servlet filter
 
Similar Threads
url-pattern for filters
Filter or ActionServlet
The problem of servlet-name in the filter-mapping
Page is displaying without name in address bar
what is displaytag filter. How is it used ?