on 2009 Apr 24 12:59 PM
Hi,
I'm trying to use a servlet filter.
I created this class:
package com.test
import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
public class myFilter implements Filter{
public void destroy() {
System.err.println("DESTROY FILTER!!");
}
public void doFilter(
ServletRequest request,
ServletResponse response,
FilterChain chain)
throws IOException, ServletException {
System.err.println("DO FILTER!!");
}
public void init(FilterConfig filterConfig) throws ServletException {
System.err.println("INIT FILTER!!");
}
}
this is the web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<filter>
<filter-name>myFilter</filter-name>
<display-name>My filter</display-name>
<filter-class>com.test.myFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>myFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
When I deploy this filter, I can see the "DESTROY FILTER!!" en "INIT FILTER!!" in the logfile.
Then I clicked some links in the portal, but there is no "DO FILTER!!" int he logfile.
Can sombody help me?
thanks,
Joachim
Is there someone who can help me?
blog about filter: [/people/guru.subramanianb/blog/2005/02/17/understanding-java-filters|/people/guru.subramanianb/blog/2005/02/17/understanding-java-filters]
This filter should execute for each request on the portal server, right?
What's wrong here? There is no "DO FILTER!!" in the default trace...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.