jsf-2.2

JSF 2.2 faces-config: Unknown Schema version: 2.2

放肆的年华 提交于 2019-11-29 01:08:11
I'm trying to use the Faces 2.2. I get an error. SEVERE: Critical error during deployment: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: com.sun.faces.config.ConfigurationException: Unable to parse document 'jndi:/server/contracts/WEB-INF/faces-config.xml': Unknown Schema version: 2.2 at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:749) at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:348) at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214) at org.apache.catalina.core

When to use preRenderView versus viewAction?

时光怂恿深爱的人放手 提交于 2019-11-28 23:27:54
When should one use the preRenderView event to initialize data for a page versus using the viewAction? Are they equal in use and do they have the same effect? preRenderView Event <f:metadata> <f:event type="preRenderView" listener="#{myBean.initialize}"/> </f:metadata> or viewAction <f:metadata> <f:viewAction action="#{myBean.initialize}"/> </f:metadata> kolossus In practice, they can be used to achieve the same effect, but viewAction (new with JSF2.2) comes with the following enhancements: onPostback : viewAction comes with this attribute that allows you to specify whether you want the action

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

夙愿已清 提交于 2019-11-28 14:40:37
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 fetchValueFromDatabase() { String resultValue = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"

web.xml setup for facelets template and client

假如想象 提交于 2019-11-28 12:50:01
问题 I've looked at a few resources for JSF and facelets, but don't understand a few configuration points. What's the distinction between: <url-pattern>/faces/*</url-pattern> and: <url-pattern>*.jsf</url-pattern> While I understand it's possible to have several url-pattern elements, unless .jsf pages are explicitly being used, there's no actual need for this mapping, correct? If only faces templates and clients are being used, then it's extraneous? Furthermore, if the facelet template and client

h:commandButton is not working once I wrap it in a <h:panelGroup rendered>

只谈情不闲聊 提交于 2019-11-28 12:45:57
The reason why the topic has "kind of" is because I have an example in JSF 2.2 where I use a commandButton and call a bean function twice (depending on the url). It's basically the same code, which executes only in one example. Here's the code with the description of the "error" below the code: User bean @ManagedBean @RequestScoped public class User { private String name; private String surname; private int age; private int id; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSurname() { return surname; } public void setSurname

How to disable jftfdi jffi query params in JSF

最后都变了- 提交于 2019-11-28 11:27:37
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? 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, the OutcomeTargetRenderer class who's responsible for HTML output generation of the <h:link> and <h:button>

The metadata component needs to be nested within a f:metadata tag. Suggestion: enclose the necessary components within <f:metadata>

白昼怎懂夜的黑 提交于 2019-11-28 11:22:11
I went through different sources like: Error saying I need to use f:metadata even though I do http://docs.oracle.com/javaee/7/javaserverfaces/2.2/vdldocs/facelets/f/metadata.html and it seems to be issue has been fixed in jsf 2.2.1, where as When I tried to use, I am facing issue, below are my configurations: template.xhtml: <!DOCTYPE html> <html lang="#{languageBean.language}" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core" xmlns:fn=

JSF: Mojarra vs. OmniFaces @ViewScoped: @PreDestroy called but bean can't be garbage collected

柔情痞子 提交于 2019-11-28 10:33:54
This question is specific to the OmniFaces @ViewScoped bean (however of interest to wider discussion about memory leakage and resource disposal with JSF @ViewScoped). It is based on the results of this NetBeans8.1 test web app available on GitHub: Investigation of undesirable holding of references to various forms of JSF @ViewScoped beans by navigation type https://github.com/webelcomau/JSFviewScopedNav That test web app has a comprehensive README with complete instructions, as well as annotated test web pages comparing obsolete JSF2.0-style @ManagedBean @ViewScoped , JSF2.2-style CDI-friendly

Should <protected-views> be used for JSF 2.2 CSRF protection?

岁酱吖の 提交于 2019-11-28 07:43:06
I am confused. I see that JSF 2.0 has implicit CSRF protection: How JSF 2.0 prevents CSRF On the other side according to the article http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/JSF-CSRF-Demo/JSF2.2CsrfDemo.html we should add the following element to the faces-config.xml file with the list of JSF pages. <protected-views> <url-pattern>/csrf_protected_page.xhtml</url-pattern> </protected-views> Should <protected-views> be used for JSF 2.2 CSRF protection? BalusC I am confused. I see that JSF 2.0 has implicit CSRF protection: How JSF 2.0 prevents CSRF This implicit protection is

java.lang.IllegalStateException: java.lang.InstantiationException while implementing a custom tag handler in JSF

回眸只為那壹抹淺笑 提交于 2019-11-28 03:40:47
问题 Given the following tag handler class. public final class ViewParamValidationFailed extends TagHandler implements ComponentSystemEventListener { private final String redirect; public ViewParamValidationFailed(TagConfig config) { super(config); redirect = getRequiredAttribute("redirect").getValue(); } @Override public void apply(FaceletContext context, UIComponent parent) throws IOException { if (parent instanceof UIViewRoot && !context.getFacesContext().isPostback()) { ((UIViewRoot) parent)