jsf-2

how to make error page (http 500) work in IceFaces?

空扰寡人 提交于 2019-12-24 02:33:09
问题 Using Icefaces 2, if an error occurs during execution of an action method on a standard (=not icefaces) h:commandButton, it just seems the button has no action. No error page is displayed, although it is configured to do so in web.xml. I can make it work by surrounding the tag with <f:ajax disabled="true">...</f:ajax> But I'd want to either disable this automatic ajax from Icefaces (see question How to disable unsollicited ajax on standard components (h:commandButton) while using Icefaces? ),

Iterate <f:verbatim> within <ui:repeat>

﹥>﹥吖頭↗ 提交于 2019-12-24 02:31:10
问题 I have a @ViewScoped bean with a List<String> containing plain HTML. I want to iterate over this list and output plain html: <c:forEach items="#{bean.list}" var="html"> <f:verbatim>#{html}</f:verbatim> </c:forEach> That snippet above works well but when the page is refreshed the bean costrunctor is recalled. This issue/bug is known: JSTL c:forEach causes @ViewScoped bean to invoke @PostConstruct on every request So the suggestion is to replace <c:forEach> with <ui:repeat> . <ui:repeat value="

Iterate <f:verbatim> within <ui:repeat>

余生长醉 提交于 2019-12-24 02:31:08
问题 I have a @ViewScoped bean with a List<String> containing plain HTML. I want to iterate over this list and output plain html: <c:forEach items="#{bean.list}" var="html"> <f:verbatim>#{html}</f:verbatim> </c:forEach> That snippet above works well but when the page is refreshed the bean costrunctor is recalled. This issue/bug is known: JSTL c:forEach causes @ViewScoped bean to invoke @PostConstruct on every request So the suggestion is to replace <c:forEach> with <ui:repeat> . <ui:repeat value="

JSF 2 dynamic form and bean validation JSR 303

徘徊边缘 提交于 2019-12-24 02:21:35
问题 I generate a dynamic form starting from annotated bean. The same bean is annotated for validation using Hibernate Validator. The form is correctly rendered but when the form is submitted the validation step it's not executed. If I write the same form with jsf tag the validation works properly. Any idea? The form page: <body> <ui:composition template="/template/basetheme_one_col.xhtml"> <ui:define name="title">#{__g4cController.entityClassName}</ui:define> <ui:define name="main_area"> <h2>#{_

Commandlink action does not work after an ajax call JSF-2.0

巧了我就是萌 提交于 2019-12-24 02:00:10
问题 The commandlink link2 does not have work after an ajax call is made to render a panel group panel1. This was working when the whole page was relaoded instead of ajax call to display the modal. Main.xhtml <h:panelGroup id="panel1"> <ui:fragment rendered="#{downloadTo.showModal}"> <ui:include src="modal.xhtml" /> </ui:fragment> </h:panelGroup> <h:form> <h:commandLink id="link" value="download" action="#{backing.openModal()}"> <f:ajax render="_panel1"/> </h:commandLink> </h:form> modal.xhtml

JSF 2.x @EJB Dependency Injection Error

本秂侑毒 提交于 2019-12-24 01:53:56
问题 So, as it usually goes in programming, I asked one question and a potential solution led to more questions (and bugs.) I'm new to using servlets, JSF, and EJBs and have run into an error with dependency injection. Here's my original question: JSF h tags not displaying I was told I needed to ask a new question, pasting my managed bean code and the stack trace that resulted from the injection error. Any help would be greatly appreciated. ManagedBean @ManagedBean(name ="draftSavvyController")

View Scoped Bean preRenderView method being called multiple times

老子叫甜甜 提交于 2019-12-24 01:53:16
问题 I have a problem with my Mojarra 2.1.6 web-application, I'm developing it using @ViewScoped managed beans and each bean is attached to an xhtml page. This page is receiving some view params and after initializing the bean in that way: <ui:composition xmlns="http://www.w3.org/1999/xhtml" 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:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui" template

Jsf file download doesn't work

纵饮孤独 提交于 2019-12-24 01:27:43
问题 When I click the h:commandButton it execute the myBean.dowanlod() method, but it doesn't download any files. Here is my methods in the backing bean. No exceptions. Cursor gets busy and seems like waiting for a response. Are there any additional configurations for this kind of operations or is there any wrong with this code? <h:commandButton value="download" action="#{myBean.download()}" /> @ManagedBean @SessionScoped public class MyBean implements Serializable{ //.... public String download{

Get List of All Managed Beans in JSF at runtime

拜拜、爱过 提交于 2019-12-24 01:23:54
问题 I'd like to get a list of all managed beans in a JSF application. In Spring, I can do something like context.getBeansOfType(). Is there a corresponding method in JSF? I have a number of @ManagedProperty beans that implement an interface. I'd like to get a list of these adapters and loop through them rather than invoke each bean explicitly in order to keep the code clean. Thank you 回答1: You can do this with BeanManager class from com.sun.faces.mgbean package: ApplicationAssociate application =

Difference between JSF view instances: new view, initial view, and postback view

守給你的承諾、 提交于 2019-12-24 01:06:16
问题 I did some research on JSF view instances: new view, initial view, and postback view. But, I am still not quite sure about the differences. It's kind of confusing and I haven't been able to find a good explanation on that. Can somebody put some light on this one? 回答1: That was how JSF 1.0/1.1 works. They are explained in detail in this ancient IBM article. But you should forget and ignore the whole article (see also "Editor's notes" section on top which was edited in afterwards). It does not