Showing results for 
Search instead for 
Did you mean: 

Servlet Filter

Active Participant
0 Kudos


I'm trying to use a servlet filter.

I created this class:

package com.test 


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" "">
		<display-name>My filter</display-name>

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?



Accepted Solutions (0)

Answers (1)

Answers (1)

Active Participant
0 Kudos

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...