dynamic view page content JSF
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.
精彩评论