jsf-2.0

Captcha in JSF 2.0

In my project I have to integrate Captcha to my Signup Form, I have seen JCaptcha and google recaptcha can anybody suggest me the best and easy way to integrate captcha. Actually I don't want third party captcha like recaptcha so how can i generate my own one. I am using JSF 2.0 and Richfaces. ...

JSF 2.0 NullPointerException exception after submitting commandButton

After mifrating JSF from 1.2 to 2.0 I begin to receive exception after submitting commandButton: javax.faces.FacesException: java.lang.NullPointerException at org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.wrap(ExceptionHandlerImpl.java:241) at org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.hand...

JSF 2.0 h:inputText inside ui:repeat

Hello everybody! How I should change following example that after changes values in inputText not disappears after commandButton was submitted? I'm understanding why it happens, but I don't know how to fix it. <h:form> <h:selectOneMenu valueChangeListener="#{foo.selectChanges}" onchange="submit()" > <f:selectItem itemValue="...

jsf component with render attribute failing validation

Hi, all I have couple of panel grids with rendered attribute, on value change event of a drop down list, I make one of the panel grids visible, this works fine. But after the panel is displayed all the conversions and validations attached to components inside panel grid fail. Even if the component is single and outside the grid it fail...

JSF 2.0 and TransformerFactory

Hi, I'm going to use Saxon-B 9 in my JSF 2.0 project. But after adding dependency to Saxon & Saxon-dom exceptions began to appear at startup: Sep 25, 2010 6:05:45 PM com.google.apphosting.utils.jetty.JettyLogger info INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger Sep 25, 2010 6:05:45 PM...

java.lang.IllegalArgumentException thrown by mapping error with JSF 2.0 and JPA , why?

Exception java.lang.IllegalArgumentException: partidosPK.idEquipo at javax.faces.component.UIComponentBase.validateId(UIComponentBase.java:551) at javax.faces.component.UIComponentBase.setId(UIComponentBase.java:366) at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply (ComponentTagHandlerDelegateImpl.java:168)...

How do I ask my JSF implementation to redirect to new view through flash?

I am using a flash module for site navigation (Freemind flash browser). However, I'm having trouble with navigation/redirection. A typical use case is as follows. From the welcome page, a user clicks on a country. Following that, the flash mind map appears. A user browses the mindmap, and clicks on a desired node. Embedded on this node, ...

JSF, override HTTP headers

Hi, I strongly need to override JSF 2.0 Content-Type header. Default it is Content-Type:application/xhtml+xml; charset=UTF-8 But I need Content-Type:text/html; charset=UTF-8 Thanks. ...

dataTable only print out the first item, if the value attribute contains square bracket

I have a h:dataTable that displays ProfileNotification like below: <h:dataTable value="#{myBean.profileNotifications}" var="item" rendered="#{myBean.renderProfileNotification}"> <h:column> <h:form> <h:outputText value="#{item.userName} "...

JSF - Change the action for a h:commandButton (2.0)

Hello. Im new into JSF 2.0. On the last version i understand that if i want change rules about "what send to the client" i just need to configure the faces-config.xml. Now, on version 2.0, how can manage the Action? For example, if i have this on a index.xhtml <h:commandButton id="submit" value="submit" action="response" /> and i nee...

JSF 2.0: Render form fields with initial data using request-scoped beans (to update server data specific to current component)

A pretty normal case: We have a 'portlet' composite component that has two states: expanded and collapsed. Portlets start as expanded, but user can collapse them by clicking on them. This state should be saved to the session, so that once the user refreshes the page or navigates to a new, the portlets remember if they are expanded/colla...

JSF 2.0 use enum in selectMany menu

I want to use enum values in a selectManyCheckbox. The checkboxes get populated correctly, however, when selecting some values and submitting them, their runtime type is String, and not enum. My code: <h:selectManyCheckbox value="#{userController.roles}" layout="pageDirection"> <f:selectItems value="#{userController.rolesSelectMany...

Primefaces lightBox problem

I have created a page with primefaces where I use the Lightbox component. I use it in a dynamic matter as I create tumbnails on the fly with a servlet call. The first page shows up nice and the lightbox works as expected but when I load a new set of pictures for the next page the pictures are shown but when you click on it, it just sho...

JSF2 and Facelets

Hi all I have tried to port JSF 1 + JSP to JSF 2 + Facelets but I have stumbled onto this error when I viewed the page in the web browser: XML Parsing Error: no element found Location: http://localhost/index.xhtml Line Number 1, Column 1: The codes of index.xhtml are: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://...

How Do Portlet-Bridge, Richfaces and ajax4jsf work together?

I am trying to get Liferay 6.0, JBoss portlet bridge 2.0 and Richfaces 4.0.0 working together by using the configuration as stated in JBoss Forum and the portlet bridge documentation. My goal is to use JSF 2.0 when implementing protlets. I use maven for building and deploying the portlet in Liferay and included the Richfaces dependancy ...

Using CDI instead of @ManagedBean: UnproxyableResolutionException because super class has no no-args constructor

Hi, I'm trying to use CDI for my JSF/Java EE application. I have the following class hierarchy: /** * base controller class * also contains some final methods and an inner enum class declaration */ public abstract class AbstractCrudController<K, E> implements Serializable { private Class<E> entityClass; public AbstractCrudCont...

JSF 2.0: What happens to object references of a managed bean across multiple ajax requests?

Assume I have a session scoped bean with object references in it, where the bean extends from an abstract generic base class. Example: public abstract class AbstractCrudController<K, E> implements Serializable { private Class<E> entityClass; private E user; public E getUser() { if (user == null) { try { ...

h:selectOneMenu default value issue when put it in h:dataTable

Hi guys, i have a problem with h:selectOneMenu. If i put it in h:dataTable i'm unable to set the default value. This is the code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt; <ui:component xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelet...

ViewScoped Bean cause NotSerializableException

Hello I'm using a ViewScoped Bean the Problem is that when call it I get the NotSerializableException. This is the code of my Managed Bean : @ManagedBean(name="demandesBean") @ViewScoped public class DemandesBean implements Serializable { private static final long serialVersionUID = 1L; @ManagedProperty(value="#{demandeService...

Adding elements to editable form using h:dataTable without submitting all the rows

Just wondering if it is possibly to dynamically add elements (in AJAX fashion) to a form using h:dataTable without always submitting the current contents? Normally one has to always send the full contents of the datatable, because the whole datatable is re-rendered. If the datatable gets big (say, 100 rows) this can radically slow down t...