jsf

Why my custom javax.faces.context.ExceptionHandler doesn't handle javax.validation.ConstraintViolationException

北战南征 提交于 2021-02-11 14:27:21
问题 My custom exception handler is not being invoked by the container to intercept (checked or unchecked) exceptions (I verified it through the debugger). I have this Entity bean class with @Email annotation for the email field, and when the user types in an invalid email through the JSF page, an error message is being displayed, however, the error message is not the one I set through the custom exception handler class, rather it is the one I have set as the default message for the @Email

Make a multiSelect drop downvalue required based in the input of previous p:selectOneMenu value

别说谁变了你拦得住时间么 提交于 2021-02-11 14:18:10
问题 I want to create a JSF application. In the application the user will have two drop downs. If a user selects the country Mexico / value 3 from the first drop down then he is required to choose the option Cancun / value 6 from the multiselect How this can be implemented? <h:form> <p:growl id="msgs" showDetail="true" skipDetailIfEqualsSummary="true" /> <p:panel header="Tranfer Destination" style="margin-bottom:10px;"> <h:panelGrid columns="2" cellpadding="5"> <p:outputLabel for="country" value=

Downloading a file using JSF

匆匆过客 提交于 2021-02-11 14:00:43
问题 Hi I am trying to download a file from server but at the end of my process I end up with only numbers and some weird characters on my browser. It's not downloading the file. I am using seam and JSF 1.2. Here is my code: public void writeBytesToResponse(UploadDefinition _instance, String path) { FacesContext context = FacesContext.getCurrentInstance(); HttpServletResponse response = (HttpServletResponse) context .getExternalContext().getResponse(); try { byte[] bytes = getFile(path); response

How to refer to a file in WebContent from inside a Java class in src [duplicate]

有些话、适合烂在心里 提交于 2021-02-11 10:13:19
问题 This question already has an answer here : Read a resource file inside JSF application (1 answer) Closed 4 years ago . I have a JSF application with the below file structure: ReportGeneratorJSF |-- src | `-- Abc.java |-- WebContent | `-- FormattedExcel | `-- abc.xls : In my Abc class I need to refer the Excel file as File file = new File("location of abc.xls"); However, whatever path I try, it comes as null . How do I figure out the right path? 回答1: The java.io.File works directly on local

Trinidad/ADF Faces, file upload, EOFException

被刻印的时光 ゝ 提交于 2021-02-11 08:55:39
问题 I use JSF 2.3 (Mojarra 2.3.3), Trinidad (2.2.1) and its file upload component (tr:inputFile) in a web.xml-version 3.1 on a Tomcat 8.5 server. I get following exception and no valid uploaded file (i.e. the "value"-binded bean attribute remains null): java.io.EOFException: null at org.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler._readLine(MultipartFormHandler.java:253) ~[trinidad-impl-2.2.1.jar:2.2.1] at org.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler.

Trinidad/ADF Faces, file upload, EOFException

房东的猫 提交于 2021-02-11 08:53:06
问题 I use JSF 2.3 (Mojarra 2.3.3), Trinidad (2.2.1) and its file upload component (tr:inputFile) in a web.xml-version 3.1 on a Tomcat 8.5 server. I get following exception and no valid uploaded file (i.e. the "value"-binded bean attribute remains null): java.io.EOFException: null at org.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler._readLine(MultipartFormHandler.java:253) ~[trinidad-impl-2.2.1.jar:2.2.1] at org.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler.

h:datatable not populated

梦想与她 提交于 2021-02-10 17:26:44
问题 This is a related (and or follow up) issue to : Event Function called before Setter So Given i have : <Td> <h:selectOneMenu id="combocarList" value="#{customerBean.selectedcar}" styleClass="comboStyle" valueChangeListener="#{customerBean.loadothercombos}" onchange="document.forms[0].submit()" > <f:selectItem itemLabel="-----------Select--------------" itemValue="None" /> <f:selectItems value="#{customerBean.carsList}" /> </h:selectOneMenu> </Td> the event is called when user selects an item

p:fileUpload - Validate form prior to upload

≡放荡痞女 提交于 2021-02-10 16:19:33
问题 I would like to be able to trigger validation on my form prior to being allowed to select the files for upload when clicking on the "Choose" button of the fileUpload control in Primefaces. Is this possible? At present the user can click on "Choose" and "Upload" without validation kicking in. This is preventing my document from saving but the attachments are being created. I know I could hide the fileUpload control until the form is successfully validated and saved but I would prefer to invoke

p:fileUpload - Validate form prior to upload

女生的网名这么多〃 提交于 2021-02-10 16:15:22
问题 I would like to be able to trigger validation on my form prior to being allowed to select the files for upload when clicking on the "Choose" button of the fileUpload control in Primefaces. Is this possible? At present the user can click on "Choose" and "Upload" without validation kicking in. This is preventing my document from saving but the attachments are being created. I know I could hide the fileUpload control until the form is successfully validated and saved but I would prefer to invoke

primefaces orderlist not getting updated with the changed order

两盒软妹~` 提交于 2021-02-09 11:08:17
问题 I have a primefaces p:orderList which is displayed in a popup on click of a button. When I change the order of Items in the orderlist, and click on Save Order button on the popup, I'm not seeing the list with the changed order. PFB my code - <p:commandButton ajax="true" id="toolOrderButton" value="Tool Order" onclick="toolOrderPopup.show()" type="button"/> <p:dialog header="Tool Order" severity="alert" widgetVar="toolOrderPopup" appendToBody="true"> <p:orderList id="toolOrderList"