Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Filter Setup

Posted on 2002-05-30
10
Medium Priority
?
338 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 400 total points
ID: 7053658
try
*/*.jsp
or
*.jsp
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

If you’re involved with your company’s wide area network (WAN), you’ve probably heard about SD-WANs. They’re the “boy wonder” of networking, ostensibly allowing companies to replace expensive MPLS lines with low-cost Internet access. But, are they …
Files go missing when using DFS (Distributed File System) Replication and how to recover them and fix it.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

704 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