field « Bean « JSF Q&A

1. What is the JSF behaviour, if you bind the same backing bean property to two input fields in the same form?

Is there a defined behaviour in JSF, if two input fields are bound to the same session scoped Backing Bean property. Here is my code snippet

<h:form id="myForm">
   <h:inputText id="field1" value="#{TheBackingBean.theProperty}" ...

2. JSF: Accessing Bean from Validator via field

I have a JSF validator that checks whether a Container Number string conforms to the ISO-6346 specficiation. It works fine, however I need to add some conditional processing in ...

3. Binding more than one input field to a backing bean property by using Java Server Faces?

Suppose i have a month, day and year select. One select for each one. And now i need to bind them to a single backing bean property - java.util.Date. How do ...

4. Input field values are null in bean action method

The input field boxes are filled with #{ad.userid} like that in all pages. And even though when I enter valid values they are giving null values in managed bean when ...

5. Value remains in form field after it is cleared in bean in JSF2

In my JSF2 application, I have "Clear" button, which is supposed to clear all the fields. However, it doesn't always work. My page fragment:

<h:form id="bi">
  <h:inputText value="#{bean.entity.firstname}" />
  <h:inputText value="#{bean.entity.surname}" ...

6. JSF Text Fields vales and not updating correctly in bean

I have a JSF xthml page with several text fields. These fields gets populated from database with the page loads. If I modify any of the values in text fields and ...

7. Weblogic 11g ignores JSF field validations (javax.validations or org.hibernate.validation..)

Hello All We are using JSF2 in weblogic11g migrated from Tomcat6 , we have JSF field validations in backing beans using Javax.validation package and org.hibernate.validator package ... Example:


8. How to intercept a failed BeanValidation/Mark input error fields

I am toying around with seam and bean validation. I have a class Foo

public class Foo { @Size(min= 3) String foo; /*getter/setter*/ }
If I create an <h:form> around that and enter ...

9. JSF: How validate fields and return error messages by bean validation?

I have a contact form and I have some fields that are validated by bean validation, how could I return bean validation error messages after submitting? For example:


10. Multiple validators on one field with JSF bean validation

i am trying to make multiple validation one one field

    @NotBlank(message = "{name.required}")
    @Max(value = 25, message = "{long.value}")
    public String name;
<h:inputText ...

11. Question about using FacesValidator (JSF Validation) and Bean Validation on one Field

i have an email field which i want to validate that it's valid email, and validate that it doesn't exist in the database, so i used for valid email pattern the @Email ...

12. Empty fields are validated on one environment but not on other environment

I have the same JSF war deployed in two environments, both environments are apparently identical (Weblogic 10.3.3). There is no entry in the web.xml for javax.faces.VALIDATE_EMPTY_FIELDS. In one of the environments, ...

13. How to skip @Pattern validation on a blank field?

I am using JSR303 bean validation annotations in my JSF managed bean to validate text input. Here are the annotations:

@Size(min=0, max=20, message = "Value cannot be more than 20 characters")
@Pattern(regexp = ...