faces-config

FacesContext not injectable in Wildfly 14 with JSF 2.3 (Mojarra, main module)

不羁的心 提交于 2019-11-30 19:49:56
问题 I have a bean: import javax.faces.context.FacesContext; import javax.faces.view.ViewScoped; ... @Named @ViewScoped public class SimpleBean implements Serializable { private static final long serialVersionUID = 1L; @Inject protected FacesContext facesContext; ... } According to https://arjan-tijms.omnifaces.org/p/jsf-23.html#1316 this should work with 2.3 ... When deploying to Wildfly 14, this results in: 13:02:33,516 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 72)

Programmatically get navigation case <to-view-id> from faces-config.xml by outcome

浪尽此生 提交于 2019-11-29 17:41:58
Is there any way to get the <to-view-id> of a navigation case in the backing bean? Let's say I want to get the <to-view-id> from the outcome success , which is supposed to be page1.xhtml . Is there any helper function? <navigation-rule> <from-view-id>start.xhtml</from-view-id> <navigation-case> <from-action>#{pageController.processPage1}</from-action> <from-outcome>success</from-outcome> <to-view-id>page1.xhtml</to-view-id> </navigation-case> <navigation-case> <from-action>#{pageController.processPage2}</from-action> <from-outcome>success</from-outcome> <to-view-id>page2.xhtml</to-view-id> <

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

a 夏天 提交于 2019-11-29 15:38:03
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 instances for the Person bean or it does matter if I do this? Does this have any effect on performance

EL resolver in faces-config.xml

梦想与她 提交于 2019-11-29 04:16:12
While working on a Spring-JSF integration, I'm seeing this entry in faces-config.xml . <application> <el-resolver> org.springframework.web.jsf.el.SpringBeanFacesELResolver </el-resolver> </application> Can someone explain what exactly <application> and <el-resolver> are? BalusC <application> represents the JSF application . Exactly the one as you can obtain as Application application = FacesContext.getCurrentInstance().getApplication(); <el-resolver> represents the EL resolver as used by JSF application . Exactly the one as you can obtain as ELResolver elResolver = application.getELResolver();

Programmatically get navigation case <to-view-id> from faces-config.xml by outcome

a 夏天 提交于 2019-11-28 11:07:40
问题 Is there any way to get the <to-view-id> of a navigation case in the backing bean? Let's say I want to get the <to-view-id> from the outcome success , which is supposed to be page1.xhtml . Is there any helper function? <navigation-rule> <from-view-id>start.xhtml</from-view-id> <navigation-case> <from-action>#{pageController.processPage1}</from-action> <from-outcome>success</from-outcome> <to-view-id>page1.xhtml</to-view-id> </navigation-case> <navigation-case> <from-action>#{pageController

java.util.MissingResourceException: Can't find bundle for base name resources.application, locale en

放肆的年华 提交于 2019-11-28 04:30:11
问题 My faces-config.xml likes below. <?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web- facesconfig_2_0.xsd" version="2.0"> <application> <message-bundle>resources.application</message-bundle> <locale-config> <default-locale>en</default-locale> </locale-config> </application> </faces-config> Xhtml file <f

EL resolver in faces-config.xml

99封情书 提交于 2019-11-27 18:16:01
问题 While working on a Spring-JSF integration, I'm seeing this entry in faces-config.xml . <application> <el-resolver> org.springframework.web.jsf.el.SpringBeanFacesELResolver </el-resolver> </application> Can someone explain what exactly <application> and <el-resolver> are? 回答1: <application> represents the JSF application. Exactly the one as you can obtain as Application application = FacesContext.getCurrentInstance().getApplication(); <el-resolver> represents the EL resolver as used by JSF

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

六月ゝ 毕业季﹏ 提交于 2019-11-27 09:43:06
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.org/xml/ns/javaee/web-facesconfig_2_3.xsd" version="2.3"> .... </faces-config> group.xhtml <ui

What is the use of faces-config.xml in JSF 2?

别来无恙 提交于 2019-11-26 15:43:36
After the JSF 2 big support for annotations, I'm wondering what I would use the faces-config.xml for. What is its importance now? In other words, what are the configurations that can only be done through faces-config.xml and not via annotations? Right now all what I am using it for is to declare Spring's EL resolver. <?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" version="2.0">

What is the use of faces-config.xml in JSF 2?

心不动则不痛 提交于 2019-11-26 04:36:08
问题 After the JSF 2 big support for annotations, I\'m wondering what I would use the faces-config.xml for. What is its importance now? In other words, what are the configurations that can only be done through faces-config.xml and not via annotations? Right now all what I am using it for is to declare Spring\'s EL resolver. <?xml version=\"1.0\" encoding=\"UTF-8\"?> <faces-config xmlns=\"http://java.sun.com/xml/ns/javaee\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=