1
votes

I am using JSF Mojarra 2.1.7 with Spring Web Flow 2.3.0.I am really stuck with this strange problem . I am really wondering if I am missing something is really simple or it is really like this in JSF.

If I put a input field on a form and give it a required attribute and fill a few fields correctly and leave one field empty , JSF gives me a nice validation error. But I left one field empty and even other ones were correcly filled they were also lost.

For instance on the form I have 2 fields name and password. Both of them contains required attribute of the JSF. I entered "My name" as value for the name field and I didn't enter any value for the password field. JSF gave me an error about password field and correct value I entered for the name field "My name" is also empty now.

Now I am wondering is this default behaviour ? How can I solve this problem. If it is normal behaviour I will be really surprized because this is a really basic requirement I think.

2
No, this is not the default behaviour. - BalusC
Hard to say without seeing an SSCCE. I've never experienced this myself before, so I can't answer from experience. My first feeling would say: blame Spring. But that can be because I've never used it. - BalusC
We are blaming Spring right now :) I will try to give a SSCCE. I have been almost reading all of your articles for days to solve this problem . - caltuntas

2 Answers

1
votes

When I upgraded to newly released Spring Web Flow 2.3.1 problem resolved.

0
votes

Same behaviour with JSF version 2.1.24 with spring EL resolver turned off. But the cause can be due to spring RequestContextListener or DelegatingFilterProxy. We only use spring security.

Update: resolved after JSF update. There is probably several related issues with jsf. One of issue: https://java.net/jira/browse/JAVASERVERFACES-3033