You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by BacardiWasabi <se...@yahoo.com> on 2001/11/13 06:06:40 UTC

Filters in Tomcat

Below code not working... why?


package filters;

import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;


public final class FilterServlet implements Filter {

private FilterConfig filterConfig = null;
public void destroy() {
this.filterConfig = null;
}

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 init(FilterConfig config) throws
ServletException{
}

}


my web.xml

 <filter>
   <filter-name>Secure</filter-name>
   <filter-class>filters.FilterServlet</filter-class>
   </filter>
   <filter-mapping>
   <filter-name>Secure</filter-name>
   <url-pattern>*.jsp</url-pattern>
</filter-mapping>

when i try to access say a.jsp - I dont see any output
from doFilter in stdout.log

Any help? ;-)



__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Filters in Tomcat

Posted by "Craig R. McClanahan" <cr...@apache.org>.
Are you running on a Windows platform?  If so, you need to remember that
output to the log files is buffered until they are closed.

Craig


On Mon, 12 Nov 2001, BacardiWasabi wrote:

> Date: Mon, 12 Nov 2001 21:06:40 -0800 (PST)
> From: BacardiWasabi <se...@yahoo.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Filters in Tomcat
>
> Below code not working... why?
>
>
> package filters;
>
> import java.io.*;
> import java.util.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
>
>
> public final class FilterServlet implements Filter {
>
> private FilterConfig filterConfig = null;
> public void destroy() {
> this.filterConfig = null;
> }
>
> 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 init(FilterConfig config) throws
> ServletException{
> }
>
> }
>
>
> my web.xml
>
>  <filter>
>    <filter-name>Secure</filter-name>
>    <filter-class>filters.FilterServlet</filter-class>
>    </filter>
>    <filter-mapping>
>    <filter-name>Secure</filter-name>
>    <url-pattern>*.jsp</url-pattern>
> </filter-mapping>
>
> when i try to access say a.jsp - I dont see any output
> from doFilter in stdout.log
>
> Any help? ;-)
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Find the one for you at Yahoo! Personals
> http://personals.yahoo.com
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>