jsf-2.2

Spring Boot JSF Integration

一世执手 提交于 2019-11-27 09:18:28
Environment : Tomcat 8 Spring Boot 1.5 JSF 2.2 Apache MyFaces Spring MVC Code : I am integrating Spring Boot and JSF 2.2 in Servlet 3.0 environment. Config Classes : JSFConfig.java - Config for JSF. @Configuration @ComponentScan({"com.atul.jsf"}) public class JSFConfig { @Bean public ServletRegistrationBean servletRegistrationBean() { FacesServlet servlet = new FacesServlet(); return new ServletRegistrationBean(servlet, "*.jsf"); } } Spring Boot Main Class : @SpringBootApplication @Import({ // @formatter:off JPAConfig.class, ServiceConfig.class, // this contains UserServiceImpl.java class.

How to initialize inputtextfield with a value from database on runtime without the use of @PostContruct?

笑着哭i 提交于 2019-11-27 08:50:45
问题 I know very well that Any scoped managed bean method annotated with @PostConstruct will be called after the managed bean is instantiated, but before the bean is placed in scope. Consider <h:inputText binding="#{bean.input}" > </h:inputText> where the managed bean is public class Bean { private HtmlInputText input; public PreInitializeBean(){ input = new HtmlInputText(); input.setMaxlength(15); input.setStyle("background: pink;"); input.setValue(fetchValueFromDatabase()); } private Object

Richfaces: show details in popup [commandbutton, action and popupPanel]

不羁岁月 提交于 2019-11-27 08:26:49
问题 I have a xhtml like this: <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.org/schema/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml"> <ui:define

h:inputFile value becomes blank after submit or validation fail of other input, how to retain its value?

百般思念 提交于 2019-11-27 08:04:45
问题 With many other standard JSF components, when a form is submitted and server side validation fails, the page is rendered again with the previously submitted form fields filled in for the user to edit and resubmit. I am looking for that same behavior from the new h:inputFile and I'm not finding it. As a simple example, I have a form with an h:inputText and an h:inputFile. The inputText has server side validation enabled. If the user enters invalid text and selects a file and submits, the file

How to disable jftfdi jffi query params in JSF

拟墨画扇 提交于 2019-11-27 06:20:57
问题 I tried the last version of JavaServer Faces 2.2 (Mojarra 2.2.4) and noticed changing my query string in this unwanted way: page.jsf?jftfdi=&jffi= instead of page.jsf I've found that it is the new JSF 2.2 feature. But these query params(jftfdi, jffi) spoil me SEO-friendly urls. How can I disable it? 回答1: This is a bug in Mojarra. They should not have been appended when there's no means of any flow navigation configuration (by the new @FlowScoped annotation and <j:flow-xxx> tags). Basically,

Bean validation doesn't work with mojarra 2.2.4

帅比萌擦擦* 提交于 2019-11-27 06:10:32
问题 I'm trying to use Hibernate Validator 5.0.1 and JSF2.2 but their integration seems to be broken since mojarra version 2.2.3. I've created small app to demonstrate the issue and get exception "javax.servlet.ServletException: Expression Error: Named Object: javax.faces.Bean not found." when running it on Tomcat 7.0.42. Does anyone else have this problem? webapp/pages/index.xhtml: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http:/

Include dynamic content containing JSF tags/components from stream

旧城冷巷雨未停 提交于 2019-11-27 05:32:29
I am working on an application where I would like to include dynamic XHTML content from a stream. To handle this I wrote a taghandler extension which dumps the dynamic XHTML content to output component as UIOutput htmlChild = (UIOutput) ctx.getFacesContext().getApplication().createComponent(UIOutput.COMPONENT_TYPE); htmlChild.setValue(new String(outputStream.toByteArray(), "utf-8")); This works fine for XHTML content which has no JSF tags. If I have JSF tags in my dynamic XHTML content like <h:inputText value="#{bean.item}"/> , then they're printed as plain text. I want them to render as input

javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL does not work anymore since Java EE 7 / EL 3.0

喜你入骨 提交于 2019-11-27 05:07:12
<context-param> <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name> <param-value>true</param-value> </context-param> Does not work with the latest Mojarra 2.2.5 on both glassfish 4 and wildfly 8 Final I have seen multiple bug reports on this, Manfried Riem says , It was determined this is an EL issue and the EL implementation has been fixed to fix this The fix versions says 2.2.5, and it is also stated in the release notes of 2.2.5, am I missing something? Fixed with a custom resolver: faces-config.xml: <application> <el-resolver>my.package

Getting ViewExpiredException in clustered environment while state saving method is set to client and user session is valid

和自甴很熟 提交于 2019-11-27 04:54:22
I have a JSF application that uses Mojarra 2.2.9 and is deployed on WebSphere 8.5.5.4 on clustered environement and javax.faces.STATE_SAVING_METHOD is set to client . Even though all my application beans are request scoped, sometimes when the user session is valid and the user is doing post request on a page he gets ViewExpiredException . What may be causing this issue and how can I solve it? Will changing the javax.faces.STATE_SAVING_METHOD to server solve it? If so, what is the impact of doing this on memory? Also, does this have anything to do with cluster environement and maybe there's

Performing a redirect, when conversion / validation associated with query parameters fails

≡放荡痞女 提交于 2019-11-27 03:36:02
问题 The following is a simple use case of <f:viewAction> . <f:metadata> <f:viewParam name="id" value="#{testManagedBean.id}" maxlength="20"/> <f:viewAction action="#{testManagedBean.viewAction}"/> </f:metadata> The managed bean involved. @ManagedBean @ViewScoped public final class TestManagedBean implements Serializable { private static final long serialVersionUID = 1L; private Long id; //Getter and setter. public void viewAction() { System.out.println("viewAction() called : " + id); } } The