• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

url rewrite

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

if user inputs "/store/1234", I need redirect to "/store.do?id=1234". Could we do it in the jstl or servlet ?

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65123
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSTL implies a JSP, and this would mean that you are using a JSP for something other than rendering a view. So, no.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Better to use a filter, or whatever URL rewriting extension your container/server supports.
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Better to use a filter,


how to write the filter ?

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65123
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please show some initiative: servlet filter.
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I found the result. Not use Spring interceptor, just put a filter before all spring.

like this


Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic