jsf-2

Redirect handling PrimeFaces Ajax requests on session timeout in Spring Security

百般思念 提交于 2019-12-20 09:26:01
问题 I am trying to get the JSF web front-end to redirect to back to the login page (in Spring Security) when the session times-out. I have tried using a meta-refresh approach, however this causes an undesired side-effect that the meta-refresh time will not be updated when only AJAX controls are used on the page. This means that the page may refresh while you are still using it, because you haven't transitioned to another page and only made AJAX calls to the server. I have not found a way to

Execute two methods in action in JSF

百般思念 提交于 2019-12-20 08:59:40
问题 Is it possible to execute two methods in action of <h:commandButton> ? For example, <h:commandButton action="#{bean.methodOne();bean.methodTwo();}" /> 回答1: You can use f:actionListener like this. <h:commandButton action="#{bean.methodOne();}"> <f:actionListener binding="#{bean.methodTwo();}" /> </h:commandButton> You can add as many f:actionListener elements as you need. 回答2: Add a methodThree in your bean : public Object methodThree() { methodOne(); methodTwo(); return someThing; } And call

JSF 2.0 Facelets nested templates inheritance

自古美人都是妖i 提交于 2019-12-20 07:44:53
问题 Is it posible to define templates that inherit from other templates in facelets? Something like this /GlobalTemplate.xhtml /users/UsersTemplate.xhtml template="/GlobalTemplate.xhtml" /users/viewUser.xhtml template="/users/UsersTemplate.xhtml" Then viewUsers.xhtml will be called by browser 回答1: Yes, it's definitely possible. 来源: https://stackoverflow.com/questions/5323937/jsf-2-0-facelets-nested-templates-inheritance

Is it possible to submit a form that has been rendered from a JSF page location in WEB-INF?

…衆ロ難τιáo~ 提交于 2019-12-20 07:28:36
问题 The JSF 2.2 web based application I am developing makes use of various error pages which are located in the WEB-INF directory and are displayed when an HTTP error or Java exception is encountered based on the configuration in the web.xml file. On some error pages I would like to include a form which allows the user to report the issue and include various attributes that would be helpful when investigating the issue such as the request URI and the error message. The issue I've got is when the

taking multiple values from inputText field separated by commas in JSF

依然范特西╮ 提交于 2019-12-20 07:12:53
问题 I am designing an email client system using JSF Framework . The UI should be capable of taking multiple recipient address in the same inputText field each of which is separated by commas(,). How can i achieve this? 回答1: As per the comments: can i assign the value attribute of inputText field to an array? You could implement a Converter for this. @FacesConverter("commaSeparatedFieldConverter") public class CommaSeparatedFieldConverter implements Converter { @Override public String getAsString

JSF p:calendar in p:dataTable: How to get the row of p:ajax dateSelect event

孤者浪人 提交于 2019-12-20 06:26:54
问题 In my setup I have a @Named Bean, the class ObWithDate is a @Entity with a date field validFrom . Objects of this class are in a List<ObWithDate> of the bean. I want to update the ObWithDate immediately if a user changes a date. The p:dataTable thus is showing several p:calendar components: <h:form id="fUser"> <p:dataTable id="dt" var="i" value="#{myBean.list}"> <p:column> <p:calendar id="cValidFrom" value="#{i.validFrom}"> <p:ajax event="dateSelect" listener="#{myBean.up}" update=":fUser:dt"

Decrease load time for data table page containing more than 500 transactions

爷,独闯天下 提交于 2019-12-20 06:09:30
问题 Is there a way to decrease the load time of the page in IE just by using Data tables. If we use server side pagination and sorting, can we also do a quick search on server side and also render only that particular tab instead of the whole page. <h:panelGroup id="transactionsPanel"> <h:dataTable> </h:dataTable> <ui:repeat value="#{backing.pages}" var="page" varStatus="current"> <h:commandLink value="#{page}" actionListener="#{backing.page}" rendered="#{page != backing.currentPage}" > <f:ajax

Is it a good idea to filter inside a JSF template?

非 Y 不嫁゛ 提交于 2019-12-20 05:46:22
问题 The first thing that I must say is that I never use a web filter on Java Web Applications so perhaps it could be a stupid idea. I'm trying to create a method that could check the privilegies of the user and give the access or not to a certains pages if he can or not access to these pages. For a better explanation I will do an example. You should imagine a crud web application ok? This application have these web pages: List.xhtml (that contains all rows and the links to manage these rows);

ViewExpiredException

一笑奈何 提交于 2019-12-20 05:27:12
问题 I am using JSF 2 ,primefaces 2.2.RC2 ,google-appengine I recently moved from myfaces-2.0.0.beta3 to myfaces-bundle-2.0.3. With this new version, I am getting the below exception very frequently,much before the actual session timeout. /login.jsfNo saved view state could be found for the view identifier: /login.jsf Caused by: javax.faces.application.ViewExpiredException - /login.jsfNo saved view state could be found for the view identifier: /login.jsf I have set my session timeout to 10 mins.

delete HtmlColumn on clicking HtmlCommandButton which is in the column itself

ε祈祈猫儿з 提交于 2019-12-20 05:22:08
问题 I have generating a HtmlCommandButton in backing bean. By clicking that button I want to delete a HtmlColumn from a HtmlDataTable which was also generated in the baking bean. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>JSF dynamic</title> </head> <body> <h:form prependId="false"> <br/><br/> <h:outputText value="Enter no. of columns : "/> <h:inputText value="#{MyTest.colNos