jsf-2.0

JSF 2 Scriptmanager style functionality

I need to be able to add some javascript to all ajax postback responses (PartialViewContext.isAjaxRequest == true) but I am not succeeding with any implementation I try. I have tried implementing a PhaseListener and adding my script using PartialResponseWriter.insert* to add eval blocks, as well as trying to add the script by creatin...

JSF 2 Content Controller (pull in content based on URI)

Hey All, I'm new to JSF and am trying to make a content controller. Basically whenever someone makes a request to www.myapp.com/external/** I'd like to forward to a controller that pulls external content into a page template and spits it out to the user. For example /external/test/test.html might pull in content from a location XXYYZZ...

How do I use jQueryUI's ui-states with JSF2's h:messages?

It seems like it should be very simple to specify that the h:messages generated by JSF should be styled using jQueryUI's nice ui-states. But sadly I can't make it fit. It seems that the jQueryUI states require several elements (div,div,p,span) in order to make it work. So taking inspiration directly from the jQueryUI theme demo page: <...

JSF 2.0: use Enum values for selectOneMenu

I'm using JSF 2.0 and want to fill a selectOneMenu with the values of my Enum. A simple example: // Sample Enum public enum Gender { MALE("Male"), FEMALE("Female"); private final String label; private Gender(String label) { this.label = label; } public String getLabel() { return this.label; } } Unfortunately, ...

Problem trying to send file to browser in JSF

Hi I've tried two different techniques for sending a file to a browser(making the user download a file). I've tried an example from myfaces wikipage FacesContext context = FacesContext.getCurrentInstance(); HttpServletResponse response = (HttpServletResponse)context.getExternalContext().getResponse(); int read = 0; byte[] b...

JSF 2 f:ajax lifecycle problem

The problem is, that if a property is changed during an f:ajax request and a binded panelGroup should be newly created depending on that changed value, the old value is used. This code will explain the problem. Here is the backingbean TestBean: public String getFirst() { return first; } public void setFirst(String firs...

How to get JSF2 working with Seam2

Hi all, Is it possible to get JSF2 working on the latest production Seam release (2.2.1.GA)? I get this error on startup: javax.faces.view.facelets.FaceletException: Must have a Constructor that takes in a ComponentConfig at com.sun.faces.facelets.tag.AbstractTagLibrary$UserComponentHandlerFactory.<init>(AbstractTagLibrary.jav...

Get Ajax4JSF (a4j component) running on Glassfish

I'm trying to build an JEE6-application on Glassfish V3, using JSF 2.0, Weld, JPA2 and Maven. Now i'm having trouble getting a simple <a4j:support> running. This is the fragment of my little example. When typing something into the inputtext, the outputtext should automatically be updated. But nothing happens (not in Firefox, not in IE8)...

JSF 2.0: Validate equality of 2 InputSecret Fields (confirm password) without writing Code?

I'm developing a pure JavaEE6 application with JSF 2.0 and Glassfish. My JSF implementation is Primefaces (beside Mojarra provided by Glassfish). I want to verify if the values of 2 password fields in a JSF form are equal. With Seam, there is the neat component <s:validateEquality for="pw1"/>. I want do to the same without Seam, just us...

Can I not submit a form to a servlet from JSF?

* Unable to find matching navigation case with from-view-id '/home.xhtml' for action 'MemoServlet' with outcome 'MemoServlet' I try to accomplish it through: <h:commandButton type="submit" value="add" action="MemoServlet"/> but all the tutorials in the world only do it with a bean, which i don't want. I've come across any navigat...

How to bind a servlet to a context?

I got javax.servlet.ServletException: Error instantiating servlet class servlets.MemoServlet javax.naming.NameNotFoundException: Name servlets.MemoServlet is not bound in this Context when using <form action="MemoServlet"> I know I could use managedbeans, but I've to use servlets. I suspect the problem has to do with JSF. context...

jsf 2.0 composite components - how to modify outer beans / attributes

Hello community, I am just learning JSF 2 and playing with simple custom components. Imagine an ajax enabled custom component with two inputText fields: ... <h:body> <composite:interface> <composite:attribute name="domId" required="true" /> <composite:attribute name="value" required="true" /> </composite:interface> <compo...

Are @ManagedBean's obsolete in JavaEE6 - because of @Named in CDI/Weld?

Because of CDI (and its implementation Weld), every POJO in JEE6 can be annotated with @Named, which makes the POJO accessible to the view. Does that mean that ManagedBeans are completely obsolete now? Or do i miss something where @ManagedBean still makes sense? ...

how to format jsf 2.0 <f:selectItems/> with date value from List

Hi, Im using jsf 2.0 to develop app where user has to select (using radio button) a date from the list of possible choices. List of dates is a managed bean property of type List< java.util.Date>. Im using facelets <h:selectOneRadio value="#{banner_backing.selectedInterval}" border="1" layout="pageDirection"> <f:selectItems val...

using facelet1.1.15 (external facelet) in JSF2

Hi! I have upgrated to JSF2 but still running with facelet1.1.15. I have these parameters in web.xml: <context-param> <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name> <param-value>com.sun.facelets.FaceletViewHandler</param-value> </context-param> <context-param> <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</pa...

authorization in JSF2

Hi! what is the best way to implement authorization in JSF2? through, servlet filter, phase listener or ther is something new that I am not aware of? ...

JSF Customize validation message for h:selectOneMenu (if nothing selected)

I have a h:selectOneMenu thats filled with enum values, which works fine. The only problem is that i don't know how to overwrite the standard JSF error message, when no valid value is selected. The error message is always bv:title: 'Choose' must be convertible to an enum from the enum that contains the constant 'Choose'. Although i have ...

JSF 2.0 webdevelopment in Intellij 9 for JBoss 6

Hi *, I was wondering what would be the most practical approach to JSF 2.0 web development using IntelliJ 9, targetting JBoss 6. My project has a Maven Structure, though I would like to shortcut the build/deployment cycle as much as possible. How can I exploit the flexibility of an exploded WAR? Can somebody point me into the right d...

JSF2.0: variable list of custom component

Hello Is there any way of using JSF2.0 in connection with variable lists of components? For example, lets say I have list o people that I would like to edit. They are presented on the page as list of components PersonEditor, which allow changing person data. Each editor is associated with single Person element. In order for this to work ...

JSF 2.0 and MyFaces Tomahawk

I have been investigating a JSF upgrade on our existing web apps that are using JSF 1.2 & tomahawk 1.1.9 & no facelets , to use JSF 2.0 & tomahawk 1.1.9 This is my findings sofar : All the tomahawk components worked except for t:dataTable used with a t:dataScroller – BUT ONLY IF preserveDataModel="true" on t:dataTable. The workaround ...