File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
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://aspose.com/file-tools
 
subject: Filters - not working for me..