• 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Wild cards in URL Mapping

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anyone please suggest how can I achive this following mapping in web.xml,

Sample call,
1.)city/abc/street/*
2.)city/abd/street/*
3.)city/*/street/*


Please note that abc & abd are just strings. Please help.

servlet>
<servlet-name>com.city.Street</servlet-name>
<servlet-class>com.city.Street</servlet-class>
<init-param>
<param-name>city.properties</param-name>
<param-value>/WEB-INF/conf/city.properties</param-value>
</init-param>

<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>com.city.Street</servlet-name>
<url-pattern>city/*/street/*</url-pattern>
</servlet-mapping>
 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
These type of wild-card patterns are not allowed in mapping of servlets in web.xml. A URL-pattern in web.xml is what starts with '/' and ends with '/*'(in case of multiple servlets). Try to use default mapping('/') or you have to come up with something else.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic