Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 82841 invoked from network); 2 Feb 2001 21:19:24 -0000 Received: from unknown (HELO infoserver.develop.com) (63.111.243.12) by h31.sny.collab.net with SMTP; 2 Feb 2001 21:19:24 -0000 Received: from yossarian (213-123-72-110.btconnect.com [213.123.72.110]) by infoserver.develop.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id DRTQQYHQ; Fri, 2 Feb 2001 13:28:31 -0800 From: "Kevin Jones" To: Subject: RE: do filters work ... Date: Fri, 2 Feb 2001 21:18:27 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 In-Reply-To: <3DAC9CD31458D411BCE700D0B75D0A1371F4A0@ES09-HOU.bmc.com> X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N I have filters working fine on TC 4.0b1 Is demo the name of your web application? If so your web.xml file should look like this prePost /* helloWorld /hello.jsp Even if demo is asubdirectory I would try the first filter mapping here (i.e. filter everything) and see if that works, Kevin Jones DevelopMentor www.develop.com > -----Original Message----- > From: Grobe, Gary [mailto:Gary_Grobe@bmc.com] > Sent: 02 February 2001 18:27 > To: 'tomcat-dev@jakarta.apache.org' > Subject: do filters work ... > > > I'm sending this to the dev group since I'm dealing w/ tomcat4.0 > (catalina) > issues and not sure how far along filters are. I can't seem to get my > filters to work so I have a basic HelloWorld that I'm using. The output of > the jsp is what my problem is. > > > Everything seems to come up fine (running in stand-alone) > > ~/logs/catalina.out shows: > ---- catalina.out --------------------------- > Starting service Tomcat-Apache > Apache Tomcat/4.0-b1 > > A shutdown would show: > > Stopping service Tomcat-Standalone > Stopping service Tomcat-Apache > Starting service Tomcat-Standalone > Apache Tomcat/4.0-b1 > > > In my ~logs/localhost_access*, the first GET (of my ~/demo/hello.jsp) > returns a 200 (after that it's a 302, anyway to force a non-cached GET?). > > -------------------------------------------- > > The output of the hello.jsp: > > _________________ this is supposed to be an
> > null > > Check console output! > > _________________ this is supposed to be an
> > > ----------------- my hello.jsp --------------------- > > > > Testing Filters > > > >
>

<%=request.getAttribute("hello")%>

>

Check console output!

>
> > > > ------------ my filter HelloWorld.java ------ > > package filters; > > import javax.servlet.*; > > public class HelloWorld extends GenericFilter > { > private FilterConfig FilterConfig; > > public void doFilter(final ServletRequest request, > final ServletResponse response, > FilterChain chain) throws java.io.IOException, > javax.servlet.ServletException { > > System.out.println("Entering HelloWorld Filter"); > > request.setAttribute("hello", "Hello World!"); > > chain.doFilter(request, response); > > System.out.println("Entering HelloWorld Filter"); > > } > } > > -------- my generic filter GenericFilter.java --------- > > package filters; > > import javax.servlet.*; > > public class GenericFilter implements javax.servlet.Filter > { > private FilterConfig filterConfig; > > public void doFilter(final ServletRequest request, > final ServletResponse response, > FilterChain chain) > throws java.io.IOException, javax.servlet.ServletException { > > chain.doFilter(request, response); > } > > public void setFilterConfig(final FilterConfig filterConfig) { > this.filterConfig = filterConfig; > } > > public FilterConfig getFilterConfig() { > return filterConfig; > } > } > > ---------------- my web.xml ------------------------ > > > > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" > "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd"> > > > > > prePost > filters.PrePostFilter > > > > helloWorld > filters.HelloWorld > > > > prePost > /demo/* > > > > helloWorld > /demo/hello.jsp > > > > > > > ---------------------------------------------------- > > On a side note: any docs on configuring catalinas, like, how to get it out > of stand-alone mode, and the configuration differences is has of previous > tomcat's (i.e. httpd.conf, etc...) > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org > For additional commands, email: tomcat-dev-help@jakarta.apache.org