jsf-2

Difference between an Enterprise application project and a Web project application in Netbeans IDE

心不动则不痛 提交于 2019-12-14 03:46:21
问题 Please I would like to know the major difference between a Jave EE project and a Java Web project in netbeans IDE with respect to the EJB . In fact you can create a web application based on EJB , JPA and JavaServer Faces in Netbeans IDE if you choose the Java Web category . On the other hand you choose the project category as Jave EE project , NetBeans IDE will create 3 sub-projects, e.g: StoreApp (Enterprise Application project), StoreApp-ejb (EJB project), and StoreApp-war (Web project).

@ViewScoped creating new instance on every postback

时光毁灭记忆、已成空白 提交于 2019-12-14 03:44:16
问题 I am having the below managed bean. But every time I do a post back to the same bean ie while calling updateFileList. I get a new instance of FileDAO. How can I prevent this? Is it safe to have a DAO inside a managed bean, if not what changes can I make to better it. @ManagedBean(name = "file") @ViewScoped public class FileController implements Serializable { private static final long serialVersionUID = 1L; private List<LoadFileLog> fileList = null; private Date selectedDate; FileDAO fileDAO;

Unable to upload the file in java

邮差的信 提交于 2019-12-14 03:35:20
问题 I am using richface and JSF . I want to upload the image file with specific path . But it give me error My jsf page is as follows <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <ui:define name="header-title"> <h:panelGroup id="headerPanelGroup"> <span>Create New User</span> </h:panelGroup> <

Generate JSF2 CRUD's - Can I create the bean and xhtml automatically for any entity?

吃可爱长大的小学妹 提交于 2019-12-14 03:33:24
问题 I'm looking for any kind of software which allows me to generate, in an automatically way, the MVC files (a bean and a xhtml view) of any CRUD of any entity using Java Server Faces 2 and Richfaces 4 technologies. I think one solution would be to use the Hibernate Tools plugin for Eclipse, creating an exporter like the Dao code generator but I don't know if it is possible or how can i do that. I search but I didn't find any documentation about it. Do you know which is the best solution for

Conditional invocation of rich:popup panel

扶醉桌前 提交于 2019-12-14 03:19:52
问题 Hello Everyone I would like to open a rich:popupPanel inside a conditional expression, actually what I'm trying is something like this: onclick="#{searchBackingBean.showLoginPanel==true ? #{rich:component('loginPopup')}.show();':''}" However I'm getting errors related to EL, how should I write this correctly?. Thanks a lot. 回答1: You may not nest EL expressions. I suggest to rewrite the expression as follows so that the condition is delegated to JavaScript: onclick="if (#{searchBackingBean

Glassfish not display JSF components

半腔热情 提交于 2019-12-14 03:14:25
问题 On my index.xhtml I have Java Server Face components which are displayed correctly and use a managed bean. But if I link to any other page or even a page with the EXACT same code those pages will not display these components, only the text. Suppose index.xhtml is like this and displays correctly: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999

Opening .docx/.docm file inline to <iframe> in IE-8 browser with JSF 2.0 is showing blank iframe with multiple session

て烟熏妆下的殇ゞ 提交于 2019-12-14 03:04:08
问题 I am using <iframe> to open MS Office 2007/2010 document file like docx/docm in a JSF 2.0 project that is deployed at Websphere App Server 8.5, and accessing its url from a client having Windows Server 2008 and MS Office 2010 installed with IE-8 browser. the src of <iframe> is the document url, the example code of <iframe> is exampled here from my .xhtml page. <iframe width = "80%" height = "90%" src = "http://<ip>/files/test.docx"> When we open the respective url with this <iframe>, test

Export to Excel using JSF 2 and XSLT

為{幸葍}努か 提交于 2019-12-14 03:03:31
问题 We used Java 5, Tomcat 5, Xalan, and JSF 1 to build an application that used XSLT, XML, and a Tomcat Filter to enable users to export their data in Excel format. We recently upgraded to Java 1.7.0_07, Tomcat 7.022 and JSF 2.1 (jsf-api-2.1.0-b03.jar). Due to the effort involved we have not yet upgraded to facelets; we still use jsp's. We use an tag to display the Excel report in its own popup window. The problem is that after the upgrade the popup is now displaying raw xml in IE, rather than

primefaces editable dataTable updates after validation failure in previous rows

时光怂恿深爱的人放手 提交于 2019-12-14 02:45:00
问题 i googled my problem a lot but it seems that no one has the same exact problem or it is solved not in what i want I have an editable <p:dataTable editable="true" editMode="cell"> it doesnot matter if cell or row (in Primefaces 3.5) I have a validation on one column which is when i enter a string > 4 validation error occur where <p:inputText> remains editable I have a <p:commandButton> when i click this button i am adding a row to this <p:dataTable> and i am updating the table for displaying

How to retrieve values of textboxes in JSF managed bean which are generated through a loop?

倖福魔咒の 提交于 2019-12-14 00:02:23
问题 I need to generate textboxes through a loop as follows. <p:panel id="dataPanel" closable="true" toggleOrientation="horizontal" toggleable="true" header="Data"> <h:panelGrid id="dataPanelGrid" columns="3" cellpadding="5"> <c:forEach var="row" items="#{zoneChargeManagedBean.list}"> <p:outputLabel for="txtCharge" value="#{row[1]}"/> <p:inputText id="txtCharge" value="#{row[2]}" converter="#{bigDecimalConverter}" onkeydown="return isNumberKey(event, this.value);" label="#{row[1]}" required="false