Ensure u have the web.xml file in the right order of elements as per the appropriate DTD And the right DTD for that matter ... Plus I'm not sure if *filter-mapping* element is mandatory ...
eg http://java.sun.com/dtd/web-app_2_3.dtd <!ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, filter*, filter-mapping*, listener*, servlet*, servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?, error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*, login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*)> I may be wrong, but I'm sure web-app2.2 doesn't allow filters http://java.sun.com/j2ee/dtds/web-app_2_2.dtd <!ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, servlet*, servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?, error-page*, taglib*, resource-ref*, security-constraint*, login-config?, security-role*, env-entry*, ejb-ref*)> If removing the element from the web.xml fixes your problem it really seems to point to the web.xml syntax as being the culprit. Regards, Mike An example filter mapping that works for me ... after <context-param> elements... <filter> <filter-name>compressionFilter</filter-name> <filter-class>CompressionFilter</filter-class> <init-param> <param-name>compressionThreshold</param-name> <param-value>10</param-value> </init-param> </filter> <filter-mapping> <filter-name>compressionFilter</filter-name> <servlet-name>compressionTest</servlet-name> </filter-mapping> before ... <servlet> elements ----- Original Message ----- From: "Bjørn T Johansen" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, September 10, 2003 3:55 PM Subject: Strange filter problem? > Hi.. > > I am trying to write my very first filter running on Tomcat, but when I > include the definition of the filter in my web.xml file, I get this > exeption..: > > org.apache.jasper.JasperException: File "/tags/struts-logic" not found > > at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler. java:105) > at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:430 ) > at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:154 ) > at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:180) > at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:354) > at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:381) > at org.apache.jasper.compiler.Parser.parseElements(Parser.java:795) > at org.apache.jasper.compiler.Parser.parse(Parser.java:122) > at org.apache.jasper.compiler.ParserController.parse(ParserController.java:199) > at org.apache.jasper.compiler.ParserController.parse(ParserController.java:153) > at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:227) > at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369) > at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:4 73) > at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:1 90) > at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) > at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) > at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) > at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) > at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) > at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) > at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) > at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) > at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) > at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) > at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) > at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) > at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) > at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:171) > at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) > at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) > at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) > at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) > at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) > at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) > at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) > at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) > at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) > at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) > at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) > at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:392) > at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) > at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:619) > at java.lang.Thread.run(Thread.java:534) > > When I remove the filter def, everything works again... > > Any suggestions? > > Btw, does using filter drain much performance? Is there any other way to ensure > that one can't access the jsp files without being logged in? A bean in every jsp page? > > > Cheers, > > BTJ > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]