我正在 JSP 中使用 UrlRewrite >在 JBoss 上进行项目.我已经配置了一些规则,所以像这样的东西:
I am using UrlRewrite in a JSP project over JBoss. I have configured some rules, so that stuff like:
mysite/parameter读取为:
mysite/index.jsp?parameter=parameter以此类推.
现在,我想知道是否有一种方法可以将用户在URL中提交的某些字符替换为其他字符.类似于Wikipedia所做的事情.当您在WikiPedia中的URL中使用空格时,将其替换为-".
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 "-".
Url是否为此重写了正确的工具?我周围也有一些过滤器,但是我想我应该能够使用UrlRewrite或类似的工具来完成此操作.
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.
推荐答案万一有人需要做同样的事情,我已经发现使用Servlets 可以过滤URL,response.sendRedirect()和request.getRequestDispatcher().forward().
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().
更多推荐
使用UrlRewrite在JSP中替换URL字符
发布评论