日期:2014-05-16 浏览次数:20466 次
<h:commandLink value="整理材料 " action="#{documentPressBackingBean.cleanDatum}" target="HideFrame"> <f:param name="documentArchiveId" value="#{pre.documentArchiveId}"></f:param> </h:commandLink> <h:outputLabel styleClass="icoArrange" id="show"> </h:outputLabel> <h:commandButton value="整理材料" action="#{documentPressBackingBean.cleanDatum}" onclick="this.form.target='HideFrame';" style="display:none"> <x:updateActionListener property="# {documentPressBackingBean.documentArchiveId}" value="#{pre.documentArchiveId}" /> </h:commandButton>
<h:form> <h:commandLink value="Test2" action="#{paramBean.test}"> <f:param name="name" value="zhang"></f:param> <f:param name="id" value="123456"></f:param> </h:commandLink> </h:form>
HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest(); request.getParameter("name");
Map varMap = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap(); varMap.get("id");
<managed-bean> <managed-bean-name>paramBean</managed-bean-name> <managed-bean-class>com.spg.bean.ParamBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> <managed-property> <property-name>id</property-name> <property-class>java.lang.String</property-class> <value>#{param.id} </value> </managed-property> </managed-bean>
<h:outputLink value="param2.jsf"> <h:outputText value="Test4"></h:outputText> <f:param name="name" value="chen"></f:param> <f:param name="id" value="123456"></f:param> </h:outputLink>
<h:outputLink value="param2.jsf?name=chen&id=123456"> <h:outputText value="Test4"></h:outputText> </h:outputLink>
<h:outputText value="#{param.name}"></h:outputText> <h:outputText value="#{param.id}"></h:outputText>
<%=request.getParameter("name")%> <%=request.getParameter("id")%>
Backing Bean import javax.faces.component.UIInput; import javax.faces.component.UIOutput; public class BackingBean { private UIOutput idComponent; public UIOutput getIdComponent() { return idComponent; } public void setIdComponent(UIOutput idComponent) { this.idComponent = idComponent; } }
<h:form> <h:inputHidden value="123456" binding="#{backingBean.idComponent}"></h:inputHidden>