• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Servlet Mapping in WebSphere

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a web application deployed in WAS 4.0. One of the URLs I want to map to a servlet has an '&' in it (for ex: /<web.app." target="_blank">http://<servername>/<web.app.>; name>/file&name). I know it's not a standard URL, but I landed up in this mess and I have to dig my way out of it. I've been trying to add a <servlet-mapping> entry in web.xml so that this URL with an & in it would be mapped to a servlet. I tried the following:

WebSphere did not like that, and the app.server returned an error when I tried to start it. (I tried this in Resin, and it did NOT give me any error, but that's beside the point). I then tried escaping the &, like below:

The App.Server started up fine this time, but when hit the URL /<web.app.Name>/file&name," target="_blank">http://<servername>/<web.app.Name>/file&name, the request is NOT mapped to the servlet. Can any one give me a clue about why the above mapping doesn't work? Thanks in advance.
-Bala.
 
Bala Krishna
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about my post above. (Misuse of the Code tags, I think).
I have a web application deployed in WAS 4.0. One of the URLs I want to map to a servlet has an '&' in it (for ex: /<web.app." target="_blank">http://<servername>/<web.app.>; name>/file&name. I know it's not a standard URL, but I landed up in this mess and I have to dig my way out of if). I've been trying to add a <servlet-mapping> entry in web.xml so that this URL with an & in it would be mapped to a servlet. I tried the following:
<servlet-mapping id="ServletMapping_5">
<servlet-name>TestServlet</servlet-name>
<url-pattern>/file&name</url-pattern>
</servlet-mapping>
WebSphere did not like that, and the app.server returned an error when I tried to start it. (I tried this in Resin, and it did NOT give me any error, but that's beside the point). I then tried escaping the &, like below:

<servlet-mapping id="ServletMapping_5">
<servlet-name>TestServlet</servlet-name>
<url-pattern>/file&name</url-pattern>
</servlet-mapping>
The App.Server started up fine this time, but when hit the URL /<web.app.Name>/file&name," target="_blank">http://<servername>/<web.app.Name>/file&name, the request is NOT mapped to the servlet. Can any one give me a clue about why the above mapping doesn't work? Thanks in advance.
-Bala.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic