0

I have a simple jsp project and I am looking for a way to have multiple uri mappings to the same page. For example I have a jsp called bookInfo.jsp, but I want 2 uri mappings: 1. /Book/{id} 2. /{bookname}/

In both cases i want the bookInfo.jsp invoked but with the uri params converted to query string.

I've read that the spring framework could make this happen, but I do not have any experience with it and I couldnt find an examples online illustrating it.

I would appreciate any pointers.

webber
  • 1,834
  • 5
  • 24
  • 56
  • 1
    Look into URL Rewriting filters, like Tuckey Urlrewrite. There's an example here: http://stackoverflow.com/questions/22696504/url-rewrite-is-redirecting-rather-than-rewriting-in-backend – developerwjk May 14 '14 at 23:40
  • In spring you can do it with @PathVariable: http://stackoverflow.com/questions/19803731/spring-mvc-pathvariable in the controller and then forward to the JSP from the controller. – developerwjk May 14 '14 at 23:45
  • Thanks developerwjk. The UrlRewrite was just what i was looking for! – webber May 17 '14 at 16:03

0 Answers0