开发者

Jsp auto forwarding

开发者 https://www.devze.com 2023-02-15 19:19 出处:网络
How I can to make auto forwarding from any dir to .jsp page with params, such as: http://site.net/foo/ -> http://site.net/show.jsp?p=foo

How I can to make auto forwarding from any dir to .jsp page with params, such as:

http://site.net/foo/ -> http://site.net/show.jsp?p=foo
http://site.net/foo2/ 开发者_运维技巧-> http://site.net/show.jsp?p=foo2
http://site.net/foo3/ -> http://site.net/show.jsp?p=foo3
http://site.net/foo4/ -> http://site.net/show.jsp?p=foo4


You can use UrlRewriterFilter to achieve this (MVC independent, since I don't know how you're implementing your webapp).


If you are using your app server behind Apache you can achieve this with mod_rewrite.

http://httpd.apache.org/docs/current/mod/mod_rewrite.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号