jsf-2

JSF 2.1 & IE Conditional Comments

家住魔仙堡 提交于 2019-12-20 11:29:39
问题 I've noticed that in JSF 2.1.* my IE conditional comments are no longer working. Various characters are being replaced by HTML entities & invalidating the comment syntax. BalusC has pointed out a solution to the problem in another question which uses h:outputText. My problem is that I want my conditional comments at the top of my page, around the first element. This means that I can't use h:outputText as I haven't defined it's namespace yet. I believe that's correct anyway. Here's a code

JSF 2.1 ViewScopedBean @PreDestroy method is not called

不想你离开。 提交于 2019-12-20 10:57:16
问题 I have a method in a view Scoped Bean with the @PreDestroy annotation and another one with the @PostConstruct annotation. The @PostConstruct method is properly called every time I navigate to the page that uses this view scoped bean. However, when I navigate to a new page (which doesn't use this view scope bean) by <h:link/> , the @PreDestroy method is never called. I am not talking about changing manually the url or the end of the session, just of a navigation case. What I am missing? Thanks

How to retrieve value of a ui:param in the backing bean

本秂侑毒 提交于 2019-12-20 10:54:41
问题 I'm passing a parameter p1 to another page page.xhtml : <ui:include src="page.xhtml"> <ui:param name="p1" value="#{someObject}"/> </ui:include> Is this possible to evaluate #{p1} inside @PostConstruct method of the backing bean of page.xhtml ? Using the following piece of code, #{p1} cannot resolve: FacesContext currentInstance = FacesContext.getCurrentInstance(); currentInstance.getApplication().evaluateExpressionGet(currentInstance, "#{p1}", String.class); Why do I need this? I'm using an

Unable to set request character encoding to UTF-8 from context [duplicate]

我的未来我决定 提交于 2019-12-20 10:54:09
问题 This question already has an answer here : Unicode input retrieved via PrimeFaces input components become corrupted (1 answer) Closed 3 years ago . I'm trying to implement example from Primefaces into WAB package. <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun

Best way to validate ajax updates in JSF 2.0?

萝らか妹 提交于 2019-12-20 10:48:40
问题 Our team is writing its first JSF 2.0 application since using Stripes for many years, and I have some questions on the best way to use the f:ajax tag and validate the input. A lot of questions I've seen answered have a form with multiple inputs and then a submit button), but we would like to maintain individual input fields updated immediately upon change and persisted to the database (with no submit button. We had this working fine in Stripes using Prototype's Ajax.Request, but it was an

How does a composite component set a property in it's client's backing bean?

两盒软妹~` 提交于 2019-12-20 10:48:27
问题 I have a composite component with an interface that contains this: <cc:attribute name="model" shortDescription="Bean that contains Location" > <cc:attribute name="location" type="pkg.Location" required="true" /> </cc:attribute> </cc:interface> So I can access the Location object in the markup with #{cc.attrs.model.location} . I also access that object from the backing bean of the composite component like this: FacesContext fc = FacesContext.getCurrentInstance(); Object obj = fc.getApplication

Are JSF 2.x @ViewScoped managed beans thread safe?

折月煮酒 提交于 2019-12-20 10:28:57
问题 I've been googling for a couple hours on this issue to no eval. WELD docs and the CDI spec are pretty clear regarding thread safety of the scopes provided. For example: Application Scope - not safe Session Scope - not safe Request Scope - safe, always bound to a single thread Conversation Scope - safe (due to the WELD proxy serializing access from multiple request threads) I can't find anything on the View Scope defined by JSF 2.x. It is in roughly the same bucket as the Conversation Scope in

JSF: value bindings inside nested ui:repeat

我是研究僧i 提交于 2019-12-20 10:21:45
问题 I have a strange problem with the <ui:repeat> tag. Even for my very simple example, value bindings inside nested repeat components do not work as expected. I have a simple facelet like so: <h:body> <h:form> <ui:repeat value="#{sandbox.rows}" var="row"> <ui:repeat value="#{row.columns}" var="column"> <h:outputText value="#{column.value}" /> <h:selectBooleanCheckbox value="#{column.value}" /> </ui:repeat> <br/> </ui:repeat> <h:commandButton action="#{sandbox.refresh}" value="Refresh" /> </h

How to re-render <ui:repeat> using <f:ajax render>

爷,独闯天下 提交于 2019-12-20 09:47:09
问题 I have implemented a list created by a repeater: <ui:repeat value="#{projectData.paginator.list}" var="project"> <h:outputText value="#{project.title}" /> </ui:repeat> and a Button that filters my list: <h:commandLink action="#{overviewController.filterNew}"> <h:outputText value="Filter List" /> </h:commandLink> So, is there an easy way to render only my repeater after clicking the command link (with AJAX) :-) I tried following: <f:ajax render="repeater"> ui:repeat id="repeater" value="#

Internationalization in JSF 2.0

半腔热情 提交于 2019-12-20 09:45:36
问题 I'm wondering how internationalization works in jsf? I have read tutorial on coreservlets.com about it, but in my case it works slightly differently. In that tutorial said that i have to use FacesContext.getCurrentInstance().getViewRoot().setLocale(newLocale); in actionListener(listener for changing locale) and also backing bean has to have property getCurrentLocale() to use it in <f:view> tag. I have 2 property files with messages(default and with specified locale), they are registered in