读书人

JSF怎么取得Request中的parameter

发布时间: 2012-10-08 19:54:56 作者: rapoo

JSF如何取得Request中的parameter

用户进入http://localhost:8080/test/active.jsf?username=xxx&activecode=yyy页面

?

?? active.jsp :

?

<h:form id="acctiveAccount_form">   <h:inputText id="username" value="#{accountActiveBean.username}" required="true" maxlength="30"/ >   <h:inputText id="activecode" value="#{accountActiveBean.activecode}" required="true" maxlength="30"/ >   <h:inputSecret id="password" value="#{accountActiveBean.password}" required="true" maxlength="20"/ >   <h:commandButton id="submitButton" value="#{messages['button_submit']}" action="#{accountActiveBean.active}" /> </h:form> 

?

如何让username和activecode得到url中的参数"xxx","yyy"?

?

1. #{param.xxx},#{param.xxx}

?

2. 可以使用这个方法获得?
????FacesContext.getCurrentInstance().getExternalContext()
??? .getRequestParameterMap().get("...");

读书人网 >JavaScript

热点推荐