File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Filter mapping based on query string

 
siva kumar
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

Can you please clarify on the below

1.) can I do a filter mapping based on query string something like

<Filter-mapping>/servletname?s=1</Filter-mapping>

2.) In the response header can I get the servlet name which has generated this response.

Thanks
Kumar
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33697
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kumar,
I don't think you can match on parameters in the filter mapping. It seems simple enough to try though. What happens when you try it?
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. No, it won't work. I don't know how the container will react, but it's not a valid url pattern. By the way, you don't put url patterns directly in the filter-mapping tag, but in the url-pattern tag of the filter-mapping tag. What you could try is :

and check if s=1 in the filter.
 
siva kumar
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Sorry I typed the tags wrongly, Yes you are right I couldnt do it in tomcat

I think it is not possible.

Thanks for your response anyway
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't map it according to querystring variables but you can read the variables from within your filter and branch accordingly.
 
siva kumar
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ben,

I am done with my filter development.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic