You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Adam Perlik <ad...@gmail.com> on 2008/02/05 20:04:22 UTC

MyFaces 1.1.5 Strange validation behaviour

Hi,

I have a jsp page with text input on it and a long range validator (0
to 999999) connected with that field.
Now I run the following scenario:
1. enter invalid value (-123)
2. submit by command button
3. Proper validator message is displayed and everything seems to work fine
4. I cancel the page by hitting another command button with
immediete='true' set, and it takes me to another page

After those actions whenever I enter the page I see the good value of
the input field or the invalid one that was rejected by the validator.
The order seems totaly random, sometimes it's in cycles of 3 (3 times
good value, 3 times bad).

Maybe somebody has seen something like this or has some Ideas what to
debug. The model i backing beans is ok and has proper values.

Thanks in advance

Re: MyFaces 1.1.5 Strange validation behaviour

Posted by Martin Marinschek <ma...@gmail.com>.
Hi Adam,

ok, I see - I had never seen this behaviour before.

regards,

Martin

On 2/7/08, Adam Perlik <ad...@gmail.com> wrote:
> The problem is caused by richfaces libraries which were in serwer
> classpath (jboss).
> It's very strange because my app didn't use any of richfaces classes
> and didn't declare richfaces filter in it's web.xml.
> After removing richfaces libs everything seems to be ok.
>
> Unfortuneatly it's not so good news afterall because I have to deploy
> another app on that server which i heavyli dependant on richfaces :(
>
> Thanks for help
> Adam
>
> 2008/2/7, Adam Perlik <ad...@gmail.com>:
> > Sorry for not being explicit
> >
> > by enter I ment navigating there by actions. When I'm on the page
> > clicking refresh in browser causes the same behaviour - sometimes the
> > correct value is shown, and sometimes the rejected one.
> >
> > Regards
> > Adam
> >
> > 2008/2/7, Martin Marinschek <ma...@gmail.com>:
> > > I do not understand this part of your question:
> > >
> > > >Although I entered correct value, when I enter the same page I get the
> > > >wrong value in some sort of cycles (sometimes it's once per five
> > > >reloadas, sometimes it's 3/3).
> > >
> > > what means "enter"? You click refresh? back-button? You navigate there
> > > with an action?
> > >
> > > regards,
> > >
> > > Martin
> > >
> > > On 2/7/08, Adam Perlik <ad...@gmail.com> wrote:
> > > > Hi,
> > > >
> > > > and there's also behavior like this:
> > > > 1. I enter wrong value
> > > > 2. Validator rejects the value and a message is shown
> > > > 3. I enter correct value and save
> > > >
> > > > Although I entered correct value, when I enter the same page I get the
> > > > wrong value in some sort of cycles (sometimes it's once per five
> > > > reloadas, sometimes it's 3/3).
> > > >
> > > > The input is declared in jsp like this:
> > > >
> > > > <h:inputText id="element_volume"
> > > >   value="#{element.editElement.volume}" required="true">
> > > >     <f:validateLongRange minimum="0" maximum="999999"/>
> > > > </h:inputText>
> > > >
> > > > the #{element} backing bean is request scoped and managed by spring.
> > > >
> > > > Are validators in JSF statefull ?
> > > > I wonder what makes the wrong data to show up.
> > > >
> > > > 2008/2/7, Adam Perlik <ad...@gmail.com>:
> > > > > Hi,
> > > > >
> > > > > no, there are no binding attributes for input elements. I'm preatty
> > > > > sure it's because the use of "cancel" command button with
> > > > > immediete="true" set on.
> > > > >
> > > > > I just can't figure out why is myfaces showing those two values in
> > > > > some sort of cycles - it would be normal if it showed the wrong
> value,
> > > > > as the one which gets set when I bypas validation by
> immediete="true".
> > > > >
> > > > > regards
> > > > > Adam
> > > > >
> > > > > 2008/2/6, Martin Marinschek <ma...@gmail.com>:
> > > > > > Hi Adam,
> > > > > >
> > > > > > do you use component-binding with a session-scoped bean?
> > > > > >
> > > > > > regards,
> > > > > >
> > > > > > Martin
> > > > > >
> > > > > >
> > > > > > On Feb 5, 2008 8:04 PM, Adam Perlik <ad...@gmail.com> wrote:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I have a jsp page with text input on it and a long range
> validator (0
> > > > > > > to 999999) connected with that field.
> > > > > > > Now I run the following scenario:
> > > > > > > 1. enter invalid value (-123)
> > > > > > > 2. submit by command button
> > > > > > > 3. Proper validator message is displayed and everything seems to
> work
> > > > fine
> > > > > > > 4. I cancel the page by hitting another command button with
> > > > > > > immediete='true' set, and it takes me to another page
> > > > > > >
> > > > > > > After those actions whenever I enter the page I see the good
> value of
> > > > > > > the input field or the invalid one that was rejected by the
> validator.
> > > > > > > The order seems totaly random, sometimes it's in cycles of 3 (3
> times
> > > > > > > good value, 3 times bad).
> > > > > > >
> > > > > > > Maybe somebody has seen something like this or has some Ideas
> what to
> > > > > > > debug. The model i backing beans is ok and has proper values.
> > > > > > >
> > > > > > > Thanks in advance
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > >
> > > > > > http://www.irian.at
> > > > > >
> > > > > > Your JSF powerhouse -
> > > > > > JSF Consulting, Development and
> > > > > > Courses in English and German
> > > > > >
> > > > > > Professional Support for Apache MyFaces
> > > > >
> > > >
> > >
> > >
> > > --
> > >
> > > http://www.irian.at
> > >
> > > Your JSF powerhouse -
> > > JSF Consulting, Development and
> > > Courses in English and German
> > >
> > > Professional Support for Apache MyFaces
> > >
> >
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: MyFaces 1.1.5 Strange validation behaviour

Posted by Adam Perlik <ad...@gmail.com>.
The problem is caused by richfaces libraries which were in serwer
classpath (jboss).
It's very strange because my app didn't use any of richfaces classes
and didn't declare richfaces filter in it's web.xml.
After removing richfaces libs everything seems to be ok.

Unfortuneatly it's not so good news afterall because I have to deploy
another app on that server which i heavyli dependant on richfaces :(

Thanks for help
Adam

2008/2/7, Adam Perlik <ad...@gmail.com>:
> Sorry for not being explicit
>
> by enter I ment navigating there by actions. When I'm on the page
> clicking refresh in browser causes the same behaviour - sometimes the
> correct value is shown, and sometimes the rejected one.
>
> Regards
> Adam
>
> 2008/2/7, Martin Marinschek <ma...@gmail.com>:
> > I do not understand this part of your question:
> >
> > >Although I entered correct value, when I enter the same page I get the
> > >wrong value in some sort of cycles (sometimes it's once per five
> > >reloadas, sometimes it's 3/3).
> >
> > what means "enter"? You click refresh? back-button? You navigate there
> > with an action?
> >
> > regards,
> >
> > Martin
> >
> > On 2/7/08, Adam Perlik <ad...@gmail.com> wrote:
> > > Hi,
> > >
> > > and there's also behavior like this:
> > > 1. I enter wrong value
> > > 2. Validator rejects the value and a message is shown
> > > 3. I enter correct value and save
> > >
> > > Although I entered correct value, when I enter the same page I get the
> > > wrong value in some sort of cycles (sometimes it's once per five
> > > reloadas, sometimes it's 3/3).
> > >
> > > The input is declared in jsp like this:
> > >
> > > <h:inputText id="element_volume"
> > >   value="#{element.editElement.volume}" required="true">
> > >     <f:validateLongRange minimum="0" maximum="999999"/>
> > > </h:inputText>
> > >
> > > the #{element} backing bean is request scoped and managed by spring.
> > >
> > > Are validators in JSF statefull ?
> > > I wonder what makes the wrong data to show up.
> > >
> > > 2008/2/7, Adam Perlik <ad...@gmail.com>:
> > > > Hi,
> > > >
> > > > no, there are no binding attributes for input elements. I'm preatty
> > > > sure it's because the use of "cancel" command button with
> > > > immediete="true" set on.
> > > >
> > > > I just can't figure out why is myfaces showing those two values in
> > > > some sort of cycles - it would be normal if it showed the wrong value,
> > > > as the one which gets set when I bypas validation by immediete="true".
> > > >
> > > > regards
> > > > Adam
> > > >
> > > > 2008/2/6, Martin Marinschek <ma...@gmail.com>:
> > > > > Hi Adam,
> > > > >
> > > > > do you use component-binding with a session-scoped bean?
> > > > >
> > > > > regards,
> > > > >
> > > > > Martin
> > > > >
> > > > >
> > > > > On Feb 5, 2008 8:04 PM, Adam Perlik <ad...@gmail.com> wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I have a jsp page with text input on it and a long range validator (0
> > > > > > to 999999) connected with that field.
> > > > > > Now I run the following scenario:
> > > > > > 1. enter invalid value (-123)
> > > > > > 2. submit by command button
> > > > > > 3. Proper validator message is displayed and everything seems to work
> > > fine
> > > > > > 4. I cancel the page by hitting another command button with
> > > > > > immediete='true' set, and it takes me to another page
> > > > > >
> > > > > > After those actions whenever I enter the page I see the good value of
> > > > > > the input field or the invalid one that was rejected by the validator.
> > > > > > The order seems totaly random, sometimes it's in cycles of 3 (3 times
> > > > > > good value, 3 times bad).
> > > > > >
> > > > > > Maybe somebody has seen something like this or has some Ideas what to
> > > > > > debug. The model i backing beans is ok and has proper values.
> > > > > >
> > > > > > Thanks in advance
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > >
> > > > > http://www.irian.at
> > > > >
> > > > > Your JSF powerhouse -
> > > > > JSF Consulting, Development and
> > > > > Courses in English and German
> > > > >
> > > > > Professional Support for Apache MyFaces
> > > >
> > >
> >
> >
> > --
> >
> > http://www.irian.at
> >
> > Your JSF powerhouse -
> > JSF Consulting, Development and
> > Courses in English and German
> >
> > Professional Support for Apache MyFaces
> >
>

Re: MyFaces 1.1.5 Strange validation behaviour

Posted by Adam Perlik <ad...@gmail.com>.
Sorry for not being explicit

by enter I ment navigating there by actions. When I'm on the page
clicking refresh in browser causes the same behaviour - sometimes the
correct value is shown, and sometimes the rejected one.

Regards
Adam

2008/2/7, Martin Marinschek <ma...@gmail.com>:
> I do not understand this part of your question:
>
> >Although I entered correct value, when I enter the same page I get the
> >wrong value in some sort of cycles (sometimes it's once per five
> >reloadas, sometimes it's 3/3).
>
> what means "enter"? You click refresh? back-button? You navigate there
> with an action?
>
> regards,
>
> Martin
>
> On 2/7/08, Adam Perlik <ad...@gmail.com> wrote:
> > Hi,
> >
> > and there's also behavior like this:
> > 1. I enter wrong value
> > 2. Validator rejects the value and a message is shown
> > 3. I enter correct value and save
> >
> > Although I entered correct value, when I enter the same page I get the
> > wrong value in some sort of cycles (sometimes it's once per five
> > reloadas, sometimes it's 3/3).
> >
> > The input is declared in jsp like this:
> >
> > <h:inputText id="element_volume"
> >   value="#{element.editElement.volume}" required="true">
> >     <f:validateLongRange minimum="0" maximum="999999"/>
> > </h:inputText>
> >
> > the #{element} backing bean is request scoped and managed by spring.
> >
> > Are validators in JSF statefull ?
> > I wonder what makes the wrong data to show up.
> >
> > 2008/2/7, Adam Perlik <ad...@gmail.com>:
> > > Hi,
> > >
> > > no, there are no binding attributes for input elements. I'm preatty
> > > sure it's because the use of "cancel" command button with
> > > immediete="true" set on.
> > >
> > > I just can't figure out why is myfaces showing those two values in
> > > some sort of cycles - it would be normal if it showed the wrong value,
> > > as the one which gets set when I bypas validation by immediete="true".
> > >
> > > regards
> > > Adam
> > >
> > > 2008/2/6, Martin Marinschek <ma...@gmail.com>:
> > > > Hi Adam,
> > > >
> > > > do you use component-binding with a session-scoped bean?
> > > >
> > > > regards,
> > > >
> > > > Martin
> > > >
> > > >
> > > > On Feb 5, 2008 8:04 PM, Adam Perlik <ad...@gmail.com> wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I have a jsp page with text input on it and a long range validator (0
> > > > > to 999999) connected with that field.
> > > > > Now I run the following scenario:
> > > > > 1. enter invalid value (-123)
> > > > > 2. submit by command button
> > > > > 3. Proper validator message is displayed and everything seems to work
> > fine
> > > > > 4. I cancel the page by hitting another command button with
> > > > > immediete='true' set, and it takes me to another page
> > > > >
> > > > > After those actions whenever I enter the page I see the good value of
> > > > > the input field or the invalid one that was rejected by the validator.
> > > > > The order seems totaly random, sometimes it's in cycles of 3 (3 times
> > > > > good value, 3 times bad).
> > > > >
> > > > > Maybe somebody has seen something like this or has some Ideas what to
> > > > > debug. The model i backing beans is ok and has proper values.
> > > > >
> > > > > Thanks in advance
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > >
> > > > http://www.irian.at
> > > >
> > > > Your JSF powerhouse -
> > > > JSF Consulting, Development and
> > > > Courses in English and German
> > > >
> > > > Professional Support for Apache MyFaces
> > >
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>

Re: MyFaces 1.1.5 Strange validation behaviour

Posted by Martin Marinschek <ma...@gmail.com>.
I do not understand this part of your question:

>Although I entered correct value, when I enter the same page I get the
>wrong value in some sort of cycles (sometimes it's once per five
>reloadas, sometimes it's 3/3).

what means "enter"? You click refresh? back-button? You navigate there
with an action?

regards,

Martin

On 2/7/08, Adam Perlik <ad...@gmail.com> wrote:
> Hi,
>
> and there's also behavior like this:
> 1. I enter wrong value
> 2. Validator rejects the value and a message is shown
> 3. I enter correct value and save
>
> Although I entered correct value, when I enter the same page I get the
> wrong value in some sort of cycles (sometimes it's once per five
> reloadas, sometimes it's 3/3).
>
> The input is declared in jsp like this:
>
> <h:inputText id="element_volume"
>   value="#{element.editElement.volume}" required="true">
>     <f:validateLongRange minimum="0" maximum="999999"/>
> </h:inputText>
>
> the #{element} backing bean is request scoped and managed by spring.
>
> Are validators in JSF statefull ?
> I wonder what makes the wrong data to show up.
>
> 2008/2/7, Adam Perlik <ad...@gmail.com>:
> > Hi,
> >
> > no, there are no binding attributes for input elements. I'm preatty
> > sure it's because the use of "cancel" command button with
> > immediete="true" set on.
> >
> > I just can't figure out why is myfaces showing those two values in
> > some sort of cycles - it would be normal if it showed the wrong value,
> > as the one which gets set when I bypas validation by immediete="true".
> >
> > regards
> > Adam
> >
> > 2008/2/6, Martin Marinschek <ma...@gmail.com>:
> > > Hi Adam,
> > >
> > > do you use component-binding with a session-scoped bean?
> > >
> > > regards,
> > >
> > > Martin
> > >
> > >
> > > On Feb 5, 2008 8:04 PM, Adam Perlik <ad...@gmail.com> wrote:
> > >
> > > > Hi,
> > > >
> > > > I have a jsp page with text input on it and a long range validator (0
> > > > to 999999) connected with that field.
> > > > Now I run the following scenario:
> > > > 1. enter invalid value (-123)
> > > > 2. submit by command button
> > > > 3. Proper validator message is displayed and everything seems to work
> fine
> > > > 4. I cancel the page by hitting another command button with
> > > > immediete='true' set, and it takes me to another page
> > > >
> > > > After those actions whenever I enter the page I see the good value of
> > > > the input field or the invalid one that was rejected by the validator.
> > > > The order seems totaly random, sometimes it's in cycles of 3 (3 times
> > > > good value, 3 times bad).
> > > >
> > > > Maybe somebody has seen something like this or has some Ideas what to
> > > > debug. The model i backing beans is ok and has proper values.
> > > >
> > > > Thanks in advance
> > > >
> > >
> > >
> > >
> > > --
> > >
> > > http://www.irian.at
> > >
> > > Your JSF powerhouse -
> > > JSF Consulting, Development and
> > > Courses in English and German
> > >
> > > Professional Support for Apache MyFaces
> >
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: MyFaces 1.1.5 Strange validation behaviour

Posted by Adam Perlik <ad...@gmail.com>.
Hi,

and there's also behavior like this:
1. I enter wrong value
2. Validator rejects the value and a message is shown
3. I enter correct value and save

Although I entered correct value, when I enter the same page I get the
wrong value in some sort of cycles (sometimes it's once per five
reloadas, sometimes it's 3/3).

The input is declared in jsp like this:

<h:inputText id="element_volume"
  value="#{element.editElement.volume}" required="true">
    <f:validateLongRange minimum="0" maximum="999999"/>
</h:inputText>

the #{element} backing bean is request scoped and managed by spring.

Are validators in JSF statefull ?
I wonder what makes the wrong data to show up.

2008/2/7, Adam Perlik <ad...@gmail.com>:
> Hi,
>
> no, there are no binding attributes for input elements. I'm preatty
> sure it's because the use of "cancel" command button with
> immediete="true" set on.
>
> I just can't figure out why is myfaces showing those two values in
> some sort of cycles - it would be normal if it showed the wrong value,
> as the one which gets set when I bypas validation by immediete="true".
>
> regards
> Adam
>
> 2008/2/6, Martin Marinschek <ma...@gmail.com>:
> > Hi Adam,
> >
> > do you use component-binding with a session-scoped bean?
> >
> > regards,
> >
> > Martin
> >
> >
> > On Feb 5, 2008 8:04 PM, Adam Perlik <ad...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > I have a jsp page with text input on it and a long range validator (0
> > > to 999999) connected with that field.
> > > Now I run the following scenario:
> > > 1. enter invalid value (-123)
> > > 2. submit by command button
> > > 3. Proper validator message is displayed and everything seems to work fine
> > > 4. I cancel the page by hitting another command button with
> > > immediete='true' set, and it takes me to another page
> > >
> > > After those actions whenever I enter the page I see the good value of
> > > the input field or the invalid one that was rejected by the validator.
> > > The order seems totaly random, sometimes it's in cycles of 3 (3 times
> > > good value, 3 times bad).
> > >
> > > Maybe somebody has seen something like this or has some Ideas what to
> > > debug. The model i backing beans is ok and has proper values.
> > >
> > > Thanks in advance
> > >
> >
> >
> >
> > --
> >
> > http://www.irian.at
> >
> > Your JSF powerhouse -
> > JSF Consulting, Development and
> > Courses in English and German
> >
> > Professional Support for Apache MyFaces
>

Re: MyFaces 1.1.5 Strange validation behaviour

Posted by Adam Perlik <ad...@gmail.com>.
Hi,

no, there are no binding attributes for input elements. I'm preatty
sure it's because the use of "cancel" command button with
immediete="true" set on.

I just can't figure out why is myfaces showing those two values in
some sort of cycles - it would be normal if it showed the wrong value,
as the one which gets set when I bypas validation by immediete="true".

regards
Adam

2008/2/6, Martin Marinschek <ma...@gmail.com>:
> Hi Adam,
>
> do you use component-binding with a session-scoped bean?
>
> regards,
>
> Martin
>
>
> On Feb 5, 2008 8:04 PM, Adam Perlik <ad...@gmail.com> wrote:
>
> > Hi,
> >
> > I have a jsp page with text input on it and a long range validator (0
> > to 999999) connected with that field.
> > Now I run the following scenario:
> > 1. enter invalid value (-123)
> > 2. submit by command button
> > 3. Proper validator message is displayed and everything seems to work fine
> > 4. I cancel the page by hitting another command button with
> > immediete='true' set, and it takes me to another page
> >
> > After those actions whenever I enter the page I see the good value of
> > the input field or the invalid one that was rejected by the validator.
> > The order seems totaly random, sometimes it's in cycles of 3 (3 times
> > good value, 3 times bad).
> >
> > Maybe somebody has seen something like this or has some Ideas what to
> > debug. The model i backing beans is ok and has proper values.
> >
> > Thanks in advance
> >
>
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces

Re: MyFaces 1.1.5 Strange validation behaviour

Posted by Martin Marinschek <ma...@gmail.com>.
Hi Adam,

do you use component-binding with a session-scoped bean?

regards,

Martin

On Feb 5, 2008 8:04 PM, Adam Perlik <ad...@gmail.com> wrote:

> Hi,
>
> I have a jsp page with text input on it and a long range validator (0
> to 999999) connected with that field.
> Now I run the following scenario:
> 1. enter invalid value (-123)
> 2. submit by command button
> 3. Proper validator message is displayed and everything seems to work fine
> 4. I cancel the page by hitting another command button with
> immediete='true' set, and it takes me to another page
>
> After those actions whenever I enter the page I see the good value of
> the input field or the invalid one that was rejected by the validator.
> The order seems totaly random, sometimes it's in cycles of 3 (3 times
> good value, 3 times bad).
>
> Maybe somebody has seen something like this or has some Ideas what to
> debug. The model i backing beans is ok and has proper values.
>
> Thanks in advance
>



-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces