Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet Mapping in WebSphere

 
Bala Krishna
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic