This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Filters - not working for me.. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply 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.


[This message has been edited by Pavan Chowdary (edited November 08, 2001).]
Win Yu
Ranch Hand

Joined: Oct 17, 2001
Posts: 224
Filter is not in the objectives, right?


Win
ruijin yang
Ranch Hand

Joined: Apr 29, 2001
Posts: 96
Hello Pavan,
I tested your filter in Tomcat 4.0 and it worked fine(I got "inside filter..." output).
ruijin yang

SUN Certified Business Component Developer Java EE Platform 5 (2008)<br />SUN Certified Developer for Java Web Services (2007)<br />IBM WebSphere Portal V5.1 Application Development (2006)<br />SUN Certified Web Component Developer (2001)<br />SUN Certified Java 2 Programmer (2001)
ruijin yang
Ranch Hand

Joined: Apr 29, 2001
Posts: 96
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?

Tim Duncan
Ranch Hand

Joined: Aug 20, 2001
Posts: 150
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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Filters - not working for me..
 
Similar Threads
Coding SuccessServlet
question on filters (HFSJ page :675)
Filters....not working for me :(
Problem invoking filter
Filter mapping for static files