【发布时间】:2011-04-09 20:56:36
【问题描述】:
我现在正在使用 JSF 为 EJB3 开发,已阅读提示如何在 JSF 中更改 URL 友好 http://balusc.blogspot.com/2007/11/friendly-urls-in-jsf.html 但我想知道如何获取页面的参数
例如,如果我使用 JSP 我有代码示例
if(("page").equals(request.getparameter("id"))
{
<jsp:include page="//sameple"// />
}
else if(("page").equals(request.getparameter("user"))
{
<jsp:include page="//samepl"// />
}
通过代码示例,我可以获得 url 的参数:http://localhost:8080/index.jsp?page=id 但是在 JSF 或友好的 URL 中,我如何使用 URL http://localhost:8080/index.jsp/page/id 获取参数
【问题讨论】:
-
您使用 JSF 2.0 吗?我不确定我是否理解你的问题,你想要像localhost:8080/index.jsp?page=id 这样的网址吗?
-
是的,我使用了 JSF 2.0,我想显示友好的 url localhost:8080/index/page/id
-
那是一篇旧文章 :) 它至少是 PrettyFaces 的作者的灵感。我会说,继续使用 PrettyFaces。
标签: jsf friendly-url