aspose file tools*
The moose likes Servlets and the fly likes url rewrite Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "url rewrite" Watch "url rewrite" New topic
Author

url rewrite

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798

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

Joined: Jan 10, 2002
Posts: 61653
    
  67

The JSTL implies a JSP, and this would mean that you are using a JSP for something other than rendering a view. So, no.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Better to use a filter, or whatever URL rewriting extension your container/server supports.
Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
David Newton wrote:Better to use a filter,


how to write the filter ?

Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61653
    
  67

Please show some initiative: servlet filter.
Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
I think I found the result. Not use Spring interceptor, just put a filter before all spring.

like this


Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: url rewrite