Question

http://foo.com/webapp/abcServlet?id=123 Need this url to be sent like below. http://foo.com/webapp/abcServlet/id/123

I can achieve passing parameters through post methods but i want a clean url. How to do this in jsp/tomcat. Servlet 3

Was it helpful?

Solution

This looks promising: http://tuckey.org/urlrewrite/manual/3.0/guide.html

From the documentation:

Clean a URL

<rule>
    <from>^/products/([0-9]+)$</from>
    <to>/products/index.jsp?product_id=$1</to>
</rule>

e.g. /products/1234 will be passed on to /products/index.jsp?product_id=1234 without the user noticing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top