faces-config

Passing redirect-param in faces-config in jsf-2.2

倾然丶 夕夏残阳落幕 提交于 2021-02-07 17:10:04
问题 In old jsf the following code was working <navigation-rule> <from-view-id>/page1.xhtml</from-view-id> <navigation-case> <from-outcome>true</from-outcome> <to-view-id>/page2.xhtml</to-view-id> <redirect> <view-param> <name>id</name> <value>#{myBean.id}</value> </view-param> </redirect> </navigation-case> </navigation-rule> page1.xhtml code : <f:metadata> <f:viewParam id="id" name="id" value="#{myBean.id}" /> <f:viewAction action="#{myBean.init()}"/> </f:metadata> Java code : public class

Passing redirect-param in faces-config in jsf-2.2

烈酒焚心 提交于 2021-02-07 17:09:00
问题 In old jsf the following code was working <navigation-rule> <from-view-id>/page1.xhtml</from-view-id> <navigation-case> <from-outcome>true</from-outcome> <to-view-id>/page2.xhtml</to-view-id> <redirect> <view-param> <name>id</name> <value>#{myBean.id}</value> </view-param> </redirect> </navigation-case> </navigation-rule> page1.xhtml code : <f:metadata> <f:viewParam id="id" name="id" value="#{myBean.id}" /> <f:viewAction action="#{myBean.init()}"/> </f:metadata> Java code : public class

JSF : ManagedBean, Good place to deal with Business Logic?

大憨熊 提交于 2020-01-11 11:43:10
问题 I have managedBean for fileUpload , once file is uploaded then i need to call different parsers based on what value is selected from the parser dropdown and then in parser am creating object of DetailsClass where am calling getDetails method for that particular class, thing to note here is that neither parserClass nor DetailsClass is registered in faces-config.xml, my question here is If i want to maintain session information from FileUpload class to Parser class to DetailsClass then I should

JSF : ManagedBean, Good place to deal with Business Logic?

99封情书 提交于 2020-01-11 11:42:11
问题 I have managedBean for fileUpload , once file is uploaded then i need to call different parsers based on what value is selected from the parser dropdown and then in parser am creating object of DetailsClass where am calling getDetails method for that particular class, thing to note here is that neither parserClass nor DetailsClass is registered in faces-config.xml, my question here is If i want to maintain session information from FileUpload class to Parser class to DetailsClass then I should

navigation rule causes JSF1064: Unable to find or serve resource

ぐ巨炮叔叔 提交于 2019-12-31 02:58:27
问题 I've the following xhtml page, that is wrapped in the major part of the other pages in my project: <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> <h:head> <title></title> </h:head> <h:form> <p:menubar> <p:menuitem value="Home" url="/protected/personal/HomeCalendar.xhtml" icon="ui-icon-home"/> <p:menuitem value="#{topbarBean

JSF faces-config.xml with external navigation-rules *.xml file

ぃ、小莉子 提交于 2019-12-24 01:44:53
问题 I have my faces-config.xml with a lot of navigation-rules inside, so I was wondering if there's a chance to write an external xml with navigation rules only, and import that nav-rules.xml into faces-config.xml. I would like to keep well structured my faces-config, because a lot of navigation rules made it too long. Thank you in advance !!! 回答1: Yes, it's possible to split webapp's own /WEB-INF/faces-config.xml file's contents over multiple files. You only need to alter the web.xml to specify

English error messages in JSF 2.0.3 (not validation)?

北慕城南 提交于 2019-12-24 00:46:28
问题 I had configured JSF 1.2 successfully to display English error messages that come from the server. Now I was making the transition to JSF 2.0, but the error messages seem to be back to German. Localized error messages are a real pain if you want to google up anything (I have no idea who decided localized error messages to be a good thing BTW!). Here's the faces-config.xml : <?xml version="1.0" encoding="UTF-8"?> <faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi=

Are there going to be two instances for a bean if I write @managed bean annotation and define same in faces-config.xml

依然范特西╮ 提交于 2019-12-18 09:06:53
问题 In my application in some places we are using @ManagedBean annoation for Person bean and for the same Person bean we defining in the faces-confing.xml like below at the same time. @ManagedBean("name=person") @SessionScoped Public class Person{ } faces-config.xml <managed-bean> <managed-bean-name>person</managed-bean-name> <managed-bean-class>com.test.sample.Person</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean> my question is does this approach create two

Changing faces-config.xml from 2.2 to 2.3 causes javax.el.PropertyNotFoundException: Target Unreachable, identifier 'bean' resolved to null

情到浓时终转凉″ 提交于 2019-12-17 10:01:59
问题 Have the following code snippets: Bean: import javax.faces.view.ViewScoped; import javax.inject.Named; @Named(value = "directoryBean") @ViewScoped public class DirectoryBean implements Serializable { private static final long serialVersionUID = 1L; .... } faces-config.xml <?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp

Prevent “.xhtml” append to “to-view-Id” within faces-config.xml

[亡魂溺海] 提交于 2019-12-13 01:25:21
问题 How do I keep extensionless URL in the to-view-id (s) within faces-config.xml so that it doesn't append .xhtml to the end of it ? For e.g. while defining a navigation case, I define a to-view-id as /topics/54233 but faces-config redirects me to /topics/54233.xhtml which I surely want to prevent. How do I do it ? 来源: https://stackoverflow.com/questions/19978988/prevent-xhtml-append-to-to-view-id-within-faces-config-xml