URL characters replacement in JSP with UrlRewrite

只谈情不闲聊 提交于 2019-12-11 10:39:17

问题


I am using UrlRewrite in a JSP project over JBoss. I have configured some rules, so that stuff like:

http://mysite/parameter

Is read as:

http://mysite/index.jsp?parameter=parameter

And so on.

Now, what I would like to know if there's a way to replace certain characters submitted in the URL by the users with others. Something like what Wikipedia does. When you use a space in the URL in WikiPedia, it's replaced by a "-".

Is UrlRewrite the right tool for this? I also have a few filters around, but I guess I shoul be able to accomplish this with UrlRewrite or a similar tool.


回答1:


In case anyone needs to do this same thing, I've found out it's possible using Servlets to filter URLs, response.sendRedirect() and request.getRequestDispatcher().forward().



来源:https://stackoverflow.com/questions/353207/url-characters-replacement-in-jsp-with-urlrewrite

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!