jsf-2

NoClassDefFoundError when deploying dynamic web app from eclipse with jsf and tomcat 7.0 [duplicate]

寵の児 提交于 2019-12-25 08:12:24
问题 This question already has answers here : java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config (2 answers) Closed 3 years ago . I am getting this error when ever deploying my jsf application java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:345) at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:154) at com

set Flash.keepMessage to true in JSF 2 configuration file is possible?

醉酒当歌 提交于 2019-12-25 08:02:47
问题 This line: FacesContext.getCurrentInstance().getExternalContext().getFlash().setKeepMessages(true); Can be changed by another code in any configuration files? I want to avoid typing this line whenever I need to redirect from code whit this line: FacesContext.getCurrentInstance().getExternalContext().redirect("errorApp"); Regards. 回答1: There is no configuration setting to change the "keep messages" feature. Just create an utility method which replaces the repeated code by a single method call.

Update form on h:commandButton action

左心房为你撑大大i 提交于 2019-12-25 07:50:07
问题 I have a button per row in a h:dataTable that deletes the record. The action works as it deletes the record. But the table doesn't update, I'm not sure what's wrong? Here's the JSF <h:form id="usersForm" rendered="#{not empty userController.users}"> <h:dataTable id="usersTable" value="#{userController.users}" var="user"> <h:column>#{user.name}</h:column> <h:column>#{user.location.location}</h:column> <h:column> <h:commandButton value="delete" action="#{userController.delete(user)}"> <f:ajax

Input fields get local values even after clearing

狂风中的少年 提交于 2019-12-25 07:49:02
问题 I have a few input fields in a form which are submitted using Save button and there is a Clear button to clear the input fields using a clear method which clears the values using setSubmittedValue(""); There is a selectonemenu on the top with a valueChangeListener which calls a method in backing bean to add a set of extra input fields for certain value of selectonemenu.(This field has ajax) First I enter some values(invalid) on the input fields and click Save so that the validation fails and

How to download file in JSF page

こ雲淡風輕ζ 提交于 2019-12-25 07:39:44
问题 I want to create JSF page which downloads Glassfish log files from the directory /opt/glassfish3/glassfish/domains/domain1/logs/ I found this Primefaces tutorial. I'm interested is there any possible way to make the same result with pure JSF? 回答1: Take a look at JCA, and look around for a good JCA adapter that provides file i/o. if you're working in a Java EE app, you probably want the transactional advantages that a properly implemented JCA adapter can/should provide (ACID, rollback, etc.)

AJAX listener not being fired for <p:selectBooleanButton> inside <p:dataList>

女生的网名这么多〃 提交于 2019-12-25 06:58:34
问题 I am trying implement an "Add item to Cart" functionality for alist f items displayed on page using <p:dataList> . The add button is a p:selectBooleanButton. I have attached an ajax listener to the button to add current item to a collection in my backing bean. However, the listener method is not being invoked but the button rendering updates. Attaching a valueChangeListener works but I assume I should not be using it? However, in either case my pagination stops working. Clicking on any of the

Bean method on rowEdit event of p:dataTable is not invoked

心已入冬 提交于 2019-12-25 06:57:43
问题 I am trying edit row from <p:dataTable> n call bean method but the problem is bean method is not invoked on rowEdit event. It will be appreciable, if someone could give me the solution. Also, my bean is already in View Scope, even not working in session scope... I have tried for all three scopes. My codes are given below : <h:form id="commentList"> <p:dataTable id="commentTable" editable="true" paginator="true" rows="10" var="comment" value="#{commentAction.list(uID)}" class="table table

Clicking browser back button after JSF navigation causes “Document expired” in browser

自作多情 提交于 2019-12-25 06:57:20
问题 In my project after login page, main page contain menu on left hand site if I clicked on menu link 1 ==> you will navigate to page 1 then click menu link 2 ==> you will navigate to page 2 ,if you use back button then i get document expired . I want to delete the browser cache after logged out for this i use phase listener. code of phase listener @Override public void beforePhase(PhaseEvent event) { FacesContext facesContext = event.getFacesContext(); HttpServletResponse response =

JSF 2.0 : A navigation case

痞子三分冷 提交于 2019-12-25 06:47:24
问题 I got a page with a form like this : <h:form> <h:commandButton value="click" action="#{searchBean.doSearch}" > <f:ajax execute="@form" render="result"></f:ajax> </h:commandButton> <a4j:outputPanel id="result" > <h:commandLink value="click" action="#{searchBean.doShowDetail(searchBean.result)}" rendered="#{searchBean.result != null}" /> </a4j:outputPanel> </h:form> doShowDetail action redirects to another page in whicth result details are shown. Result is correctly rendered after form

PrimeFaces wizard with captcha

南楼画角 提交于 2019-12-25 06:16:11
问题 I am trying implement <p:captcha> into <p:wizard> PrimeFaces. I found only this post with similar problem, when capcha in a wizard will disappear on invalid input. The proposed solution doesn't work for me. Main question: is possible insert capcha into PrimeFaces wizard by some propper way? Thanks for any replies! 回答1: I didn't come up with a proper solution (the AJAX update of wizard tabs prevents the iframe of the Recaptcha control to be reloaded) but I created a simple workaround: position