Solved

Filter Setup

Posted on 2002-05-30
10
320 Views
Last Modified: 2010-04-01
I am having trouble setup a filter to function on only my jsp files. Below is what i have in my web.xml file. But it does not function.  How do i specify this correctly?

<filter>
<filter-name>SemestreSelectedFilter</filter-name>
<filter-class>ies.SemestreSelectedFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SemestreSelectedFilter</filter-name>
<url-pattern>/*.jsp</url-pattern>
</filter-mapping>

Thanks
0
Comment
Question by:menreeq
  • 4
  • 4
  • 2
10 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 7044658
what is not working?

How do you know your filter is not being invoked?

Make sure you are using a servlet engine (Tomcat 4.0 and greater or a servlet engine that supports Servlet 2.3 spec) that supports Filters.

CJ
0
 

Author Comment

by:menreeq
ID: 7046600
When i use "/*.jsp" it does not invoke the filter for any files.  I know it works because when i change it to "/*" it functions on all the files, including the images in the sub-directory.  

Perhaps it´s due to me calling url-pattern and not specifying a valid pattern?  Or is "/*.jsp" a valid url-pattern?
0
 
LVL 4

Accepted Solution

by:
pellep earned 100 total points
ID: 7053658
try
*/*.jsp
or
*.jsp
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 19

Expert Comment

by:cheekycj
ID: 7053836
have you tried just this:

<filter-mapping url-pattern="*.jsp" filter-name="ies.SemestreSelectedFilter" />

or

<filter-mapping url-pattern="/*.jsp" filter-name="ies.SemestreSelectedFilter" />
0
 

Author Comment

by:menreeq
ID: 7056112
I have tried *.jsp.

I will try now /*.jsp and */*.jsp

0
 
LVL 4

Expert Comment

by:pellep
ID: 7056181
<url-pattern>*.jsp</url-pattern>
has always worked for me. it could be that there is already a 'default' filter in place defined earlier in the web.xml file.
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7075683
any updates?
0
 

Author Comment

by:menreeq
ID: 7076313
Ya, my computer got a virus, trying to resrore everthing.  Will try your suggestion just as soon as i have everything back online.
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7076320
ok.  sorry to hear about the virus.. take your time and let us know.

CJ
0
 

Author Comment

by:menreeq
ID: 7080061
Once again sorry for the delay. I tried *.jsp with out the / and it worked.  Thanks for the help!
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to group array of objects ? 5 65
some methods private some are not 8 212
IE doesn't Invoke servlet in iframe 1 111
java operators 3 116
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
In this increasingly digital world, security hacks are no longer just a threat, but a reality. As we've witnessed with Target's big identity hack 2013, Heartbleed in 2015, and now Cloudbleed, companies and their leaders need to prepare for the unthi…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question