aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes filters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "filters" Watch "filters" New topic
Author

filters

sandeep kumar thommandru
Greenhorn

Joined: Dec 30, 2011
Posts: 21
hai friends,
my tomcat application status is showing false..
the mistake is in web.xml i think so..

my web.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>Filters</display-name>
<servlet>
<servlet-name>targ</servlet-name>
<servlet-class>Filt3</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>targ</servlet-name>
<url-pattern>/Filt3</url-pattern>
</servlet-mapping>
<filter>
<filter-name>targ</filter-name>
<filter-class>Filt3</filter-class>
</filter>
<filter>
<filter-name>targ</filter-name>
<filter-class>Filt3</filter-class>
</filter>
<filter-mapping>
<filter-name>targ</filter-name>
<url-pattern>/Filt3</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>targ</filter-name>
<url-pattern>/Filt3</url-pattern>
</filter-mapping>
</web-app>

when i remove the filter tags,it is working..
can any anyone help me why it was showing false while using filters here?
or any mistake in the file?
please help me..
Ankur Gargg
Ranch Hand

Joined: Sep 11, 2011
Posts: 55

Hi

<filter-name>targ</filter-name>
<filter-class>Filt3</filter-class>
</filter>
<filter>
<filter-name>targ</filter-name>
<filter-class>Filt3</filter-class>
</filter>

This snipped seems wrong as you can't have two filters with the same name.
If you change the name then container will create two instances of that filter.

Regards
Ankur Garg



sandeep kumar thommandru
Greenhorn

Joined: Dec 30, 2011
Posts: 21
ha ha very silly mistake :P

thank you ankur..
sandeep kumar thommandru
Greenhorn

Joined: Dec 30, 2011
Posts: 21
hello ankur.. its again not working..

web.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>Filters</display-name>
<servlet>
<servlet-name>targ</servlet-name>
<servlet-class>Filt3</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>targ</servlet-name>
<url-pattern>/Filt3</url-pattern>
</servlet-mapping>
<filter>
<filter-name>filt1</filter-name>
<filter-class>Filt1</filter-class>
</filter>
<filter>
<filter-name>filt2</filter-name>
<filter-class>Filt2</filter-class>
</filter>
<filter-mapping>
<filter-name>targ</filter-name>
<url-pattern>/Filt3</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>targ</filter-name>
<url-pattern>/Filt3</url-pattern>
</filter-mapping>
</web-app>
sandeep kumar thommandru
Greenhorn

Joined: Dec 30, 2011
Posts: 21
ya ya filter-names in mapping section. k k got it
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: filters