dcsimg
Ignoring the "/" in a request
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   imran_khan
Posted On:   Tuesday, March 22, 2005 08:10 PM

Assume my servlets name is MyApp. I am making a GET request in the form GET http://localhost:8080/MyApp/xyz Now in this case I get a message saying that the file xyz does not exist. This is ok because xyz does not exist. But what I would like to do is before tomcat can complain about the file xyz not existing I would like to be able to extract xyz. That is I would like tomcat to ignore the "/" and treat the xy z as another parameter. Im not sure if that is as clear as it could be. Basically I want to be able to treat xyz as a parameter being passed to the servlet MyApp without tomcat thinking xyz is actually a file. Thanks Imran    More>>

Assume my servlets name is MyApp. I am making a GET request in the form

GET http://localhost:8080/MyApp/xyz

Now in this case I get a message saying that the file xyz does not exist. This is ok because xyz does not exist. But what I would like to do is before tomcat can complain about the file xyz not existing I would like to be able to extract xyz.

That is I would like tomcat to ignore the "/" and treat the xy z as another parameter.

Im not sure if that is as clear as it could be. Basically I want to be able to treat xyz as a parameter being passed to the servlet MyApp without tomcat thinking xyz is actually a file.

Thanks

Imran

   <<Less

Re: Ignoring the "/" in a request

Posted By:   Christopher_Koenigsberg  
Posted On:   Friday, March 25, 2005 07:02 PM

use web.xml, map "MyApp/*" to your servlet, and parse the URI to get the trailing part after the last slash.
About | Sitemap | Contact