• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multiple url-pattern in filter-mapping OC4j 10.1.3.3 Servlet 2.5

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I can not get the multiple url-pattern to work. Maybe I misunderstand what is provided in 2.5. Let me give you what I am trying and someone can tell me how badly I have misread the new features



And at the top ...



In this case only the last url-pattern listed is applied, not all of them as I want.
 
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm pretty sure you need to list them as:
 
Greg Werner
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried the comma as suggested and now neither path works
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, sorry. I don't know where I saw that. I just tried something similar for servlet mappings in an IDE and it created multiple <servlet-mapping> element blocks. Can you try that? For example:Sorry for my misdirection.
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Multiple <url-pattern> elements should be fine, but the value /einwenig/*.jsp isn't really a valid pattern. See SRV.11.2 of the Servlet 2.5 Spec.
 
Greg Werner
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Ah, sorry. I don't know where I saw that. I just tried something similar for servlet mappings in an IDE and it created multiple <servlet-mapping> element blocks. Can you try that? For example:"

Yes that works just fine, but that is Servlet 2.4 style and I am trying to avoid the problem of extra typing.
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
multiple url-pattern can be specified using comma separated like


or it can be specified as


it can NOT be specified as


because <url-pattern> element is allowed only once under <filter-mapping> .
 
Greg Werner
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Multiple <url-pattern> elements should be fine, but the value /einwenig/*.jsp isn't really a valid pattern. See SRV.11.2 of the Servlet 2.5 Spec. "

Thanks for the section in the document. I read it and I agree with you, ths spec does not seem to allow for the pattern I am attempting. I could do *.jsp or I could do /einwenig/* but not /einwenig/*.jsp

My overall problem is that my directory structure is much larger and can not be easily captured with *.jsp and /einwenig/* solutions. I do not wish to apply the filter to all *.jsp files and there are a few directories where I only wish to apply the filter to some of the files. Perhaps I can play around with my directory structure to get /einwenig/* to work but lots of manual work for me ahead.

Just one last shot out there to the community, does the equivalent of /einwenig/*.jsp exist?
 
Kris Schneider
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ravishanker kumar wrote:because <url-pattern> element is allowed only once under <filter-mapping> .



This is the Servlet 2.5 schema definition for <filter-mapping>:


So I respectfully disagree with your statement.
 
Kris Schneider
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Greg Werner wrote:Just one last shot out there to the community, does the equivalent of /einwenig/*.jsp exist?



In lieu of rolling your own URL pattern processor, you might want to see if something like UrlRewriteFilter can be of help.
 
Ravishanker kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kris Schneider,
You are absolutely correct, in Servlet 2.5 its allowed. Thanks for this correction
 
Greg Werner
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


So I respectfully disagree with your statement.



That is fine, but through actually running my web app,



does not work



does not work



does work. Could be an OC4J thing? I will look at the UrlRewriteFilter thing on Monday. Thanks for the tip.
 
Kris Schneider
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Greg Werner wrote:Could be an OC4J thing?



Right, I'm pretty sure that OC4J 10.1.3 is a Servlet 2.4 container. So, you should probably fix up your deployment descriptor to match, but that won't make a difference in terms of the URL pattern you're trying to process...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic