我读过如何使用 JSF 发送参数,但如果用户在访问登录页面时在 URL 中输入他们的 corpitationId
。 例如,
我们现在这样做的方式是, 有一些脚本代码从请求中抓取值, 然后在会话中设置它。 该参数会改变它们的外观和感觉, 从登录页面开始, 这样每个客户可以有一个不同的登录页面视图 。 我们使用 extjs, 直到我切换到 JSF 。
有没有办法用JSF 2或可能用PrimeFaces来做?
我读过如何使用 JSF 发送参数,但如果用户在访问登录页面时在 URL 中输入他们的 corpitationId
。 例如,
我们现在这样做的方式是, 有一些脚本代码从请求中抓取值, 然后在会话中设置它。 该参数会改变它们的外观和感觉, 从登录页面开始, 这样每个客户可以有一个不同的登录页面视图 。 我们使用 extjs, 直到我切换到 JSF 。
有没有办法用JSF 2或可能用PrimeFaces来做?
是的,您可以使用 < a href=""http://docs.oracle.com/javaee/6/javaserverfaces/2.1/docs/vdldocs/f/viewParam.html" rel="noreferr"\\code_lt;f:viewParam> 将请求参数设定为管理过的豆的属性。
<f:metadata>
<f:viewParam name="companyId" value="#{bean.companyId}" />
</f:metadata>
您可以使用
<f:metadata>
<f:viewParam name="companyId" value="#{bean.companyId}" />
<f:viewAction action="#{bean.onload}" />
</f:metadata>
使用 时,您甚至可以返回导航结果 。
public String onload() {
// ...
return "somepage";
}
在JSF2.2尚未公布时,您可以使用 < a href="http://docs.oracle.com/javaee/6/api/javax/faces/context/ExternalContext.html#redirect(java.lang.String)" rel=“nreferrer”\code>ExternalCtext#redirect () 。请参见What can <f:metadata>, <f:viewParam> and <f:viewAction> be used for?
url 参数参数也可以作为请求参数处理,这样您也可以通过
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap()
有一个公共图书馆,"http://showcase.omnifaces.org/cdi/Param" rel="noreferrer">OmniFaces ,在盒子里可以做到这一点。
@Inject @Param
private String key;
@Inject @Param
private Long id;
如果您想要获得完整的查询参数字符串, 您可以使用 request.getQueryString ()
。
We have a search form where the filter is bound to a property on a managed bean (session scope). It s not component binding, its property binding like <h:inputText value="#{searchBean.filter}"/>....
I m having trouble with a JSF selectManyCheckbox and A4J support. The purpose is to run some action when a checkbox is selected. This works perfectly in Firefox. Yet, when testing in any IE (ie6 / ie7 ...
Can anyone teach me how to use mojarra to encode my JSF files. I downloaded mojarra and expected some kind of jar but what i had downloaded was a folder of files i don t know what to do with
在共同基金中,如果用户要求终止,就需要采取一些行动。 我需要某种拦截器,但我不知道如何这样做。 我需要帮助。 增 编
Is there any way of just getting the content of the browsed file without any upload/file transfer operations? I currently use ICEFaces inputFile component but I do not need the default uploading ...
I have two JSPs where I am displaying some info from database in a h:dataTable. One of them is showing all the info, and one of them user specifically. I have showXML.jsp that shows the "XML" column ...
The problem is, that after displaying the ResultSet with <h:dataTable>, the connection is left open. If I close it, it closes the ResultSet too. I m thinking about copying the ResultSet data ...
How do I submit only part of a page in ADF Faces?