Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Filters - not working for me..

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


[This message has been edited by Pavan Chowdary (edited November 08, 2001).]
 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Filter is not in the objectives, right?
 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Pavan,
I tested your filter in Tomcat 4.0 and it worked fine(I got "inside filter..." output).
ruijin yang
 
ruijin yang
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Win,
Someone who passed SCWCD said he got questions on filter.
ruijin yang

Originally posted by Win Yu:
Filter is not in the objectives, right?


 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by ruijin yang:
Someone who passed SCWCD said he got questions on filter.


I think you are mistaken. It has certainly not been mentioned by anyone on this forum.
 
Hey, check out my mega multi devastator cannon. It's wicked. It makes this tiny ad look weak:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic