wood burning stoves 2.0*
The moose likes JSP and the fly likes Filters....not working for me :( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Filters....not working for me :(" Watch "Filters....not working for me :(" New topic
Author

Filters....not working for me :(

Pavan Chowdary
Greenhorn

Joined: Nov 08, 2001
Posts: 2
web.xml
<filter>
<filter-name>Secure</filter-name>
<filter-class>filter.FilterServlet</filter-class>
</filter>
<filter-mapping>
<filter-name>Secure</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
public class FilterServlet implements Filter
{
public void doFilter(ServletRequest req , ServletResponse resp , FilterChain fchain) throws IOException , ServletException
{
if (!req.isSecure())
{
System.out.println("inside filter....");
fchain.doFilter(req , resp);
}
else
{
System.out.println("sfasfdsdfaf");
}
}
public void destroy()
{
}
public void init(FilterConfig config) throws ServletException
{
}
}
when i access a.jsp ...above filter class is not printing appropriate system.out.

Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
<url-pattern>*.jsp</url-pattern>
Try this:
<url-pattern>/*.jsp</url-pattern>
URL pattern should start with a /
- satya
ps:
Not sure if you are still around
:roll:


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Filters....not working for me :(