jsf-2

What's the difference between Development and Production in MyFaces

一笑奈何 提交于 2019-12-23 07:11:00
问题 I'm doing some development work in JSF with MyFaces and I got this warning. ******************************************************************* *** WARNING: Apache MyFaces-2 is running in DEVELOPMENT mode. *** *** ^^^^^^^^^^^ *** *** Do NOT deploy to your live server(s) without changing this. *** *** See Application#getProjectStage() for more information. *** ******************************************************************* What is the difference between development and production mode? Are

EL evaluation in a JSF page is not sequential

霸气de小男生 提交于 2019-12-23 06:04:55
问题 I have an XHTML with ui:composition tag which I am loading on AJAX. I am using a jQuery Ajax GET to load the URL of this XHTML. In the loaded page, I have an EL expression and after that I am also including another source which has a few more EL expressions. invariably, the EL expressions of the included source are being evaluated earlier than the one appearing before it. Some.xhtml <ui:composition ... #{relationshipAction.followMember(param['relateToProfile'])} <ui:include src="someOther

ViewScoped bean is recreated everytime I click on commandButton in my dataTable

浪子不回头ぞ 提交于 2019-12-23 05:49:10
问题 Im using primefaces version 3.1.1, Mojarra 2.1.3, Netbeans 7.0.1, Glassfish Server 3.1. My test application is using a facelet template with top, left, content, right and bottom layout with raw divs and css. After user logs in with container managed jdbcrealm, they will be presented with the main index.html which use the said template. I put a navigation menu on the left panel which will subsequently update center panel content with ajax upon clicking menuitem. The center panel will be

How PrimeFaces Socket works?

本秂侑毒 提交于 2019-12-23 05:27:41
问题 My code: <p:socket channel="/allposts/#{uview.user.uid}"> <p:ajax event="message" async="true" listener="#{uview.go}" update="xout"/> </p:socket> #1. uview refers to a view scoped bean. Everything ,including update, works except listener method. Listener method is never invoked. Even if I change the value of listener to a method which is not existing, it isn't reporting any error. Any idea why it isn't working? Another thing I noticed in the following code snippet[involving dynamic id]: <p

TomEE on eclipse, How to call a remote EJB from a JSF Managed bean?

我的未来我决定 提交于 2019-12-23 05:25:30
问题 I want to have JSF 2.0 page in one instance of TomEE server calling a Remote EJB running under a different TomEE server, (both obviously running on different ports). This is what I have done in eclipse... AppEJB - is a EJB project that contains all the ejb code. AppEJBInterfaces - This project contains all the remote interfaces, the idea is that this jar will be added to the class path of the web application project containing JSF front end. AppWeb - is the Dynamic Web Application project

How to change the size(width) of p:fileupload in prime faces

别来无恙 提交于 2019-12-23 04:59:11
问题 I have a p:fileupload but its size can not be reduced. I checked the primefaces3.1 user manual but could not find an attribute to reduce the size of the component.Because of this my fileUpload componenet cut crosses the panel.Please help.I tried to width= but it did not succeed.Below is the code that i use: <p:fileUpload fileUploadListener="#{editBean.editFileUpload}" width="10px" process="studyPlanEditForm:displayname1" update=":studyPlanEditForm"> </p:fileUpload> 回答1: You can use the

Values of selected options in dynamic h:selectManyListbox dont change

烈酒焚心 提交于 2019-12-23 04:58:16
问题 I'm creating dynamic h:selectManyListbox(es) using c:forEach but it seems that when I select different options from the h:selectManyListbox, the value corresponding to the selected options doesn't change. Here is my code. Please help I'm new with JSF 2. This is my xhtml section (#{item.selectedBranches} not updated when options are selected) : <h:body> Hi <h:form id="hehe"> <c:forEach items="#{branchesController.dynamicListBoxBean}" var="item" > <h3> <h:outputLabel value="#{item.category}"/>

JSF javax.faces.convert Converter getAsString Object null

泪湿孤枕 提交于 2019-12-23 04:52:30
问题 I am working on an application and I used JSF within this application, I wrote a Java class which implements this interface JSF javax.faces.convert , and also overwrite the method getAsString of Converter, here is the Java doc of this method: java.lang.String getAsString(FacesContext context, UIComponent component, java.lang.Object value) But sometimes, the value here is Null , sometimes it works well, does anybody know that why this value is null here? how to prevent it to happen? 回答1: It

HttpSession cannot be resolved to a type in jsf logout

不打扰是莪最后的温柔 提交于 2019-12-23 04:52:22
问题 HttpSession cannot be resolved to a type in jsf logout public class LogoutBean { public String Logout() { // FacesContext context = FacesContext.getCurrentInstance(); // ExternalContext ec = context.getExternalContext(); // // final HttpServletRequest request = (HttpServletRequest)ec.getRequest(); // request.getSession( false ).invalidate(); ((HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false)).invalidate(); return "login"; } } 来源: https://stackoverflow.com

Primefaces Calendar Setting Date Value in Backing Bean

喜夏-厌秋 提交于 2019-12-23 04:45:30
问题 I am using Primefaces inline (no popup) calendar on my JSF page. When the page is initially loaded, the calendar shows today's date. Initially the backing bean's value attached to calendar's date is empty. Now when I submit the form without selecting a date (no mouse select), the today's date value is not being set in backing bean. Isn't this a bug? Why am I forced to select a date when the date is already highlighted on a calendar when page is loaded? Primefaces 3.4.2, JSF 2.2, Glassfish 4