开发者

dynamic view page content JSF

开发者 https://www.devze.com 2023-01-15 22:12 出处:网络
i am now using JSF to develop for EJB3, it was read tip how to change URL friendly in JSF http://balusc.blogspot.com/2007/11/friendly-urls-in-jsf.html

i am now using JSF to develop for EJB3, it was read tip how to change URL friendly in JSF http://balusc.blogspot.com/2007/11/friendly-urls-in-jsf.html but i wonder how can i get parameter for my page

for e开发者_如何学Cxample if i use JSP i have code sample

if(("page").equals(request.getparameter("id"))
{
       <jsp:include page="//sameple"// />
}
else if(("page").equals(request.getparameter("user"))
{
       <jsp:include page="//samepl"// />
}

with code sample i can get parameter for url : http://localhost:8080/index.jsp?page=id but in JSF or friendly URL how can i get parameter with URL http://localhost:8080/index.jsp/page/id


Have a look at the pretty faces project (http://ocpsoft.com/prettyfaces/). It provides URL rewriting for JSF and servlet. You can make the URLs as "pretty" as you like, and map your parameters into the query string format expected by the JSF 2 viewParams, or inject them into your managed beans directly.

It is an incredibly flexible solution to say the least.

0

精彩评论

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