You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Johan Borchers <jo...@solcon.nl> on 2010/04/16 08:52:14 UTC

A few extval questions

Hello,

I'm using Tomcat 6.0.20, Mojarra 1.2_14, RichFaces 3.3.3 and Extval 1.2.3 on Mac en Windows with Java 1.6.0_17
The Extval libs are:
extval-annotation-based-bypass-validation-1.2.3.jar
myfaces-extval-core-1.2.3.jar
myfaces-extval-generic-support-1.2.3.jar
myfaces-extval-property-validation-1.2.3.jar

Extval is helping me al lot with bypass-validation because of fields in a form that perform looking up values.
E.g. a manufacturer code field is required in the big picture. But the field is also performing an AJAX lookup of the manufacturer as you leave the field. At that moment it is legal to leave the field blank because you are just tabbing through your fields. So marking the lookup method with @BypassValidation(all = true) works perfect.

Question 1 :
Is it possible to use also the normal validation mechanism of JSF in combination with Extval?

E.g I have 3 fields on a form with 2 fields having Extval @required validation and one field has the traditional validation property required="true" in the XHTML page.
Sending the form with 3 blank fields gives me 2 faces messages back. Only the messages due to Extval validation.
So for me it looks like Extval is disabling the JSF validation defined in the XHTML page.

A little bit more strange is the behavior of the one field without Extval validation if I'm adding a validation to the field like <f:validateLength minimum="2" maximum="10"/>
If I send the form with one character in the field and the 2 other fields are left blank I receive 3 faces messages (that's nice).
And then after retrieving the records from the database showing up in a list clicking on the list fills normally all three fields in the form, but with the f:validateLength the field is left blank.
Removing the f:validateLength from the field gives be back the normal behavior showing the data from the database.


Question 2 :
Where to place the Extval libraries?

For developing I'm using 1 Tomcat installation per project. I do add all the libraries to the lib directory of Tomcat. Placing also the Extval libraries to this directory has a little problem.
If i'm setting my locale to nl_NL and have a Messages_nl_NL.properties in my root package Mojarra will find it and Extval not. I do get the missing resource exception.
Even using the special parameter in web.xml giving a hint to Extval finding the message bundle does not help.
But I thought that has something to to with the classloader. I decided to place just the Extval libraries in the WEB-INF/lib directory. After that Extval is finding my locale specific message bundle perfectly even without the hint in web.xml.
I know it is better to place all third party libs in WEB-INF/lib as of class loading but during development redeploying the web app a lot of times gives problems with e.g. reloading Mojarra. 


So that's a lot of text for few questions!

I want to use Extval because of the flexible validation options. I hope someone can answer my questions so I will better understand how to use Extval?

T.I.A.

Johan Borchers

Re: A few extval questions

Posted by Rudy De Busscher <rd...@gmail.com>.
Johan,

I tried to recreate the problem that the properties file can't be found.
I made a war that contains only the ExtVal libs and the JSF jars (with
commons logging and JSTL) were placed in the lib directory of tomcat.
I used you config options (about locale config) in the webfaces-config file.

 Tested only standalone (outside the IDE) but couldn't find any issue. At
least for the @length annotation, there was no problem.

So at this time I can't help you any further with that. Sorry

regards
Rudy.


On 16 April 2010 16:13, Gerhard Petracek <ge...@gmail.com> wrote:

> hi johan,
>
> >@Validator
> besides @Validator you can implement an annotation + an adapter [1] for
> your
> existing jsf validators which need special attributes.
>
> >"required"-attribute
> by default extval shouldn't modify the "required"-attribute (if you don't
> use a component lib which offers e.g. client-side validation (like
> trinidad)).
> however, some add-ons for dynamic validation (e.g. bypassing
> validation,...)
> have to reset the "required"-attribute in combination with component
> initialization. imo we should see a release of the mentioned add-on quite
> soon. i'll check (before the release) if the add-on follows the default
> approach of extval.
>
> regards,
> gerhard
>
> [1] http://jsfcentral.com/articles/myfaces_extval_3.html
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
> 2010/4/16 Rudy De Busscher <rd...@gmail.com>
>
> > Johan
> >
> > Do I understand that if I use the DEACTIVATE_COMPONENT_
> > >
> > > INITIALIZATION with
> > > value true I do disable the JSF validation at all in favor of the
> ExtVal
> > > validation?
> >
> >
> > The other way around.  With that parameter set to true, ExtVal doesn't
> > touch
> > the 'classic' attributes of the components in the tree like required and
> > maxLength.  So JSF validation runs unaltered, after the ExtVal
> validation.
> >
> > But it is much better and easier to go ExtVal all the way.  If you have
> > custom JSF validators written, you can reuse them with the @Validator
> > annotation.
> >
> > About the properties file, I'll try to recreate the situation and try to
> > find a solution.
> >
> > Rudy
> >
> >
> > On 16 April 2010 14:52, Johan.borchers <jo...@solcon.nl> wrote:
> >
> > > Hello Rudy and others.
> > >
> > > Thanks for the answers .
> > >
> > > Q1
> > > Disappearing of the field value with JSF validation only appears if I
> > > first submit the form with 3 invalid fields and the JSF validation is
> > > triggered. After that the field is not updated anymore by selecting a
> row
> > > from the list. Only after pushing the refresh button of the browser
> > > restores the normal behavior. Maybe it's also something of RichFaces
> > > because clicking on the list an refreshing the detail panel is done by
> > > AJAX.
> > >
> > > But if you say just go all the way with ExtVal than the problem will
> > > disappear.
> > > Oke if I do understand, the required attribute of JSF is never working
> > > because Extval overrides it.
> > > The other JSF validators should do their work but it's better to go all
> > > the way with Extval.
> > >
> > > Do I understand that if I use the DEACTIVATE_COMPONENT_INITIALIZATION
> > with
> > > value true I do disable the JSF validation at all in favor of the
> ExtVal
> > > validation?
> > >
> > > Q2
> > > My Messages_nl_NL.properties file is my dutch replacement of the
> standard
> > > Messages_xx_XX.properties files delivered by Mojarra. I put this file
> in
> > > the default package (root) of my webapp classes.
> > >
> > > In the faces-config.xml file I have the following elements:
> > >  <locale-config>
> > >   <default-locale>nl_NL</default-locale>
> > >  </locale-config>
> > > and
> > >  <message-bundle>Messages</message-bundle>
> > >
> > > If I put the ExtVal libraries in the Tomcat lib directory Extval can't
> > > find the resource bundle.
> > > Even if I try to use the CUSTOM_MESSAGE_BUNDLE context-param to point
> to
> > > the messages bundle.
> > >
> > > After putting the ExtVal libraries in WEB-INF/lib my dutch messages are
> > > loaded even without setting the CUSTOM_MESSAGE_BUNDLE context-param.
> > >
> > > At this moment I'm not able to show this app in the internet.
> > > But it's a good idea to work on that because looking at the app is
> > > sometimes better than 1000 words.
> > >
> > > Regards Johan
> > >
> > > >Hi Johan,
> > > >
> > > >Q1
> > > >Yes, you can combine the JSF validation with ExtVal, like you already
> > > >found
> > > >out since you got 3 messages, 2 of extval and one of JSF.
> > > >Although, the idea is that you do everything with ExtVal.  You can use
> > > >@Length as a replacement for the f:validateLength tag.
> > > >
> > > >Except for the required attribute of the components. This required
> > > >attribute
> > > >is overwritten by the ExtVal code based on the annotations it find on
> > the
> > > >property. (so when no annotations set, attribute shouldn't be altered)
> > > >
> > > >You can deactivate that behaviour by specifying the web context
> > parameter
> > > >    <context-param>
> > > >
> > >
> > >
> >
> ><param-name>org.apache.myfaces.extensions.validator.DEACTIVATE_COMPONENT_INITIALIZATION</param-name>
> > > >        <param-value>true</param-value>
> > > >    </context-param>
> > > >
> > > >You also loose then some functionality related to the validation of
> > empty
> > > >fields (like specified in the JSF 2.0 spec for example
> > > >javax.faces.VALIDATE_EMPTY_FIELDS)
> > > >
> > > >The parameter can be of help about the problem of the value that
> > > >disappears.
> > > >I can't see any reason why the f:validateLength tag impacts the
> display
> > of
> > > >the field value.  By using the web context parameter, we make sure the
> > > >annotation based bypass validation add-on can't interfere with the
> > > >encoding
> > > >of the page (and thus preventing the display of the field)
> > > >
> > > >I tried to recreate you problem with that but had no luck.
> > > >
> > > >Q2
> > > >This could be a classloading problem of Tomcat.
> > > >Which of the parameters in web.xml did you try,
> > > >JPA_VALIDATION_ERROR_MESSAGES or CUSTOM_MESSAGE_BUNDLE
> > > >
> > > >But you also say that, when ExtVal Libraries placed in WEB-INF/lib you
> > > >don't
> > > >need to specify any parameter and all messages are displayed
> correctly.
> > > >So
> > > >which messages have you placed in the properties file that are related
> > to
> > > >ExtVal.
> > > >
> > > >Regards
> > > >Rudy.
> > > >
> > > >On 16 April 2010 08:52, Johan Borchers <jo...@solcon.nl>
> > wrote:
> > > >
> > > >> Hello,
> > > >>
> > > >> I'm using Tomcat 6.0.20, Mojarra 1.2_14, RichFaces 3.3.3 and Extval
> > > >> 1.2.3
> > > >> on Mac en Windows with Java 1.6.0_17
> > > >> The Extval libs are:
> > > >> extval-annotation-based-bypass-validation-1.2.3.jar
> > > >> myfaces-extval-core-1.2.3.jar
> > > >> myfaces-extval-generic-support-1.2.3.jar
> > > >> myfaces-extval-property-validation-1.2.3.jar
> > > >>
> > > >> Extval is helping me al lot with bypass-validation because of fields
> > in
> > > >> a
> > > >> form that perform looking up values.
> > > >> E.g. a manufacturer code field is required in the big picture. But
> the
> > > >> field is also performing an AJAX lookup of the manufacturer as you
> > leave
> > > >> the
> > > >> field. At that moment it is legal to leave the field blank because
> you
> > > >> are
> > > >> just tabbing through your fields. So marking the lookup method with
> > > >> @BypassValidation(all = true) works perfect.
> > > >>
> > > >> Question 1 :
> > > >> Is it possible to use also the normal validation mechanism of JSF in
> > > >> combination with Extval?
> > > >>
> > > >> E.g I have 3 fields on a form with 2 fields having Extval @required
> > > >> validation and one field has the traditional validation property
> > > >> required="true" in the XHTML page.
> > > >> Sending the form with 3 blank fields gives me 2 faces messages back.
> > > >> Only
> > > >> the messages due to Extval validation.
> > > >> So for me it looks like Extval is disabling the JSF validation
> defined
> > > >> in
> > > >> the XHTML page.
> > > >>
> > > >> A little bit more strange is the behavior of the one field without
> > > >> Extval
> > > >> validation if I'm adding a validation to the field like
> > > >> <f:validateLength
> > > >> minimum="2" maximum="10"/>
> > > >> If I send the form with one character in the field and the 2 other
> > > >> fields
> > > >> are left blank I receive 3 faces messages (that's nice).
> > > >> And then after retrieving the records from the database showing up
> in
> > a
> > > >> list clicking on the list fills normally all three fields in the
> form,
> > > >> but
> > > >> with the f:validateLength the field is left blank.
> > > >> Removing the f:validateLength from the field gives be back the
> normal
> > > >> behavior showing the data from the database.
> > > >>
> > > >>
> > > >> Question 2 :
> > > >> Where to place the Extval libraries?
> > > >>
> > > >> For developing I'm using 1 Tomcat installation per project. I do add
> > all
> > > >> the libraries to the lib directory of Tomcat. Placing also the
> Extval
> > > >> libraries to this directory has a little problem.
> > > >> If i'm setting my locale to nl_NL and have a
> Messages_nl_NL.properties
> > > >> in
> > > >> my root package Mojarra will find it and Extval not. I do get the
> > > >> missing
> > > >> resource exception.
> > > >> Even using the special parameter in web.xml giving a hint to Extval
> > > >> finding
> > > >> the message bundle does not help.
> > > >> But I thought that has something to to with the classloader. I
> decided
> > > >> to
> > > >> place just the Extval libraries in the WEB-INF/lib directory. After
> > that
> > > >> Extval is finding my locale specific message bundle perfectly even
> > > >> without
> > > >> the hint in web.xml.
> > > >> I know it is better to place all third party libs in WEB-INF/lib as
> of
> > > >> class loading but during development redeploying the web app a lot
> of
> > > >> times
> > > >> gives problems with e.g. reloading Mojarra.
> > > >>
> > > >>
> > > >> So that's a lot of text for few questions!
> > > >>
> > > >> I want to use Extval because of the flexible validation options. I
> > hope
> > > >> someone can answer my questions so I will better understand how to
> use
> > > >> Extval?
> > > >>
> > > >> T.I.A.
> > > >>
> > > >> Johan Borchers
> > >
> > >
> > >
> >
>

Re: A few extval questions

Posted by Gerhard Petracek <ge...@gmail.com>.
hi johan,

>@Validator
besides @Validator you can implement an annotation + an adapter [1] for your
existing jsf validators which need special attributes.

>"required"-attribute
by default extval shouldn't modify the "required"-attribute (if you don't
use a component lib which offers e.g. client-side validation (like
trinidad)).
however, some add-ons for dynamic validation (e.g. bypassing validation,...)
have to reset the "required"-attribute in combination with component
initialization. imo we should see a release of the mentioned add-on quite
soon. i'll check (before the release) if the add-on follows the default
approach of extval.

regards,
gerhard

[1] http://jsfcentral.com/articles/myfaces_extval_3.html

http://www.irian.at

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

Professional Support for Apache MyFaces

2010/4/16 Rudy De Busscher <rd...@gmail.com>

> Johan
>
> Do I understand that if I use the DEACTIVATE_COMPONENT_
> >
> > INITIALIZATION with
> > value true I do disable the JSF validation at all in favor of the ExtVal
> > validation?
>
>
> The other way around.  With that parameter set to true, ExtVal doesn't
> touch
> the 'classic' attributes of the components in the tree like required and
> maxLength.  So JSF validation runs unaltered, after the ExtVal validation.
>
> But it is much better and easier to go ExtVal all the way.  If you have
> custom JSF validators written, you can reuse them with the @Validator
> annotation.
>
> About the properties file, I'll try to recreate the situation and try to
> find a solution.
>
> Rudy
>
>
> On 16 April 2010 14:52, Johan.borchers <jo...@solcon.nl> wrote:
>
> > Hello Rudy and others.
> >
> > Thanks for the answers .
> >
> > Q1
> > Disappearing of the field value with JSF validation only appears if I
> > first submit the form with 3 invalid fields and the JSF validation is
> > triggered. After that the field is not updated anymore by selecting a row
> > from the list. Only after pushing the refresh button of the browser
> > restores the normal behavior. Maybe it's also something of RichFaces
> > because clicking on the list an refreshing the detail panel is done by
> > AJAX.
> >
> > But if you say just go all the way with ExtVal than the problem will
> > disappear.
> > Oke if I do understand, the required attribute of JSF is never working
> > because Extval overrides it.
> > The other JSF validators should do their work but it's better to go all
> > the way with Extval.
> >
> > Do I understand that if I use the DEACTIVATE_COMPONENT_INITIALIZATION
> with
> > value true I do disable the JSF validation at all in favor of the ExtVal
> > validation?
> >
> > Q2
> > My Messages_nl_NL.properties file is my dutch replacement of the standard
> > Messages_xx_XX.properties files delivered by Mojarra. I put this file in
> > the default package (root) of my webapp classes.
> >
> > In the faces-config.xml file I have the following elements:
> >  <locale-config>
> >   <default-locale>nl_NL</default-locale>
> >  </locale-config>
> > and
> >  <message-bundle>Messages</message-bundle>
> >
> > If I put the ExtVal libraries in the Tomcat lib directory Extval can't
> > find the resource bundle.
> > Even if I try to use the CUSTOM_MESSAGE_BUNDLE context-param to point to
> > the messages bundle.
> >
> > After putting the ExtVal libraries in WEB-INF/lib my dutch messages are
> > loaded even without setting the CUSTOM_MESSAGE_BUNDLE context-param.
> >
> > At this moment I'm not able to show this app in the internet.
> > But it's a good idea to work on that because looking at the app is
> > sometimes better than 1000 words.
> >
> > Regards Johan
> >
> > >Hi Johan,
> > >
> > >Q1
> > >Yes, you can combine the JSF validation with ExtVal, like you already
> > >found
> > >out since you got 3 messages, 2 of extval and one of JSF.
> > >Although, the idea is that you do everything with ExtVal.  You can use
> > >@Length as a replacement for the f:validateLength tag.
> > >
> > >Except for the required attribute of the components. This required
> > >attribute
> > >is overwritten by the ExtVal code based on the annotations it find on
> the
> > >property. (so when no annotations set, attribute shouldn't be altered)
> > >
> > >You can deactivate that behaviour by specifying the web context
> parameter
> > >    <context-param>
> > >
> >
> >
> ><param-name>org.apache.myfaces.extensions.validator.DEACTIVATE_COMPONENT_INITIALIZATION</param-name>
> > >        <param-value>true</param-value>
> > >    </context-param>
> > >
> > >You also loose then some functionality related to the validation of
> empty
> > >fields (like specified in the JSF 2.0 spec for example
> > >javax.faces.VALIDATE_EMPTY_FIELDS)
> > >
> > >The parameter can be of help about the problem of the value that
> > >disappears.
> > >I can't see any reason why the f:validateLength tag impacts the display
> of
> > >the field value.  By using the web context parameter, we make sure the
> > >annotation based bypass validation add-on can't interfere with the
> > >encoding
> > >of the page (and thus preventing the display of the field)
> > >
> > >I tried to recreate you problem with that but had no luck.
> > >
> > >Q2
> > >This could be a classloading problem of Tomcat.
> > >Which of the parameters in web.xml did you try,
> > >JPA_VALIDATION_ERROR_MESSAGES or CUSTOM_MESSAGE_BUNDLE
> > >
> > >But you also say that, when ExtVal Libraries placed in WEB-INF/lib you
> > >don't
> > >need to specify any parameter and all messages are displayed correctly.
> > >So
> > >which messages have you placed in the properties file that are related
> to
> > >ExtVal.
> > >
> > >Regards
> > >Rudy.
> > >
> > >On 16 April 2010 08:52, Johan Borchers <jo...@solcon.nl>
> wrote:
> > >
> > >> Hello,
> > >>
> > >> I'm using Tomcat 6.0.20, Mojarra 1.2_14, RichFaces 3.3.3 and Extval
> > >> 1.2.3
> > >> on Mac en Windows with Java 1.6.0_17
> > >> The Extval libs are:
> > >> extval-annotation-based-bypass-validation-1.2.3.jar
> > >> myfaces-extval-core-1.2.3.jar
> > >> myfaces-extval-generic-support-1.2.3.jar
> > >> myfaces-extval-property-validation-1.2.3.jar
> > >>
> > >> Extval is helping me al lot with bypass-validation because of fields
> in
> > >> a
> > >> form that perform looking up values.
> > >> E.g. a manufacturer code field is required in the big picture. But the
> > >> field is also performing an AJAX lookup of the manufacturer as you
> leave
> > >> the
> > >> field. At that moment it is legal to leave the field blank because you
> > >> are
> > >> just tabbing through your fields. So marking the lookup method with
> > >> @BypassValidation(all = true) works perfect.
> > >>
> > >> Question 1 :
> > >> Is it possible to use also the normal validation mechanism of JSF in
> > >> combination with Extval?
> > >>
> > >> E.g I have 3 fields on a form with 2 fields having Extval @required
> > >> validation and one field has the traditional validation property
> > >> required="true" in the XHTML page.
> > >> Sending the form with 3 blank fields gives me 2 faces messages back.
> > >> Only
> > >> the messages due to Extval validation.
> > >> So for me it looks like Extval is disabling the JSF validation defined
> > >> in
> > >> the XHTML page.
> > >>
> > >> A little bit more strange is the behavior of the one field without
> > >> Extval
> > >> validation if I'm adding a validation to the field like
> > >> <f:validateLength
> > >> minimum="2" maximum="10"/>
> > >> If I send the form with one character in the field and the 2 other
> > >> fields
> > >> are left blank I receive 3 faces messages (that's nice).
> > >> And then after retrieving the records from the database showing up in
> a
> > >> list clicking on the list fills normally all three fields in the form,
> > >> but
> > >> with the f:validateLength the field is left blank.
> > >> Removing the f:validateLength from the field gives be back the normal
> > >> behavior showing the data from the database.
> > >>
> > >>
> > >> Question 2 :
> > >> Where to place the Extval libraries?
> > >>
> > >> For developing I'm using 1 Tomcat installation per project. I do add
> all
> > >> the libraries to the lib directory of Tomcat. Placing also the Extval
> > >> libraries to this directory has a little problem.
> > >> If i'm setting my locale to nl_NL and have a Messages_nl_NL.properties
> > >> in
> > >> my root package Mojarra will find it and Extval not. I do get the
> > >> missing
> > >> resource exception.
> > >> Even using the special parameter in web.xml giving a hint to Extval
> > >> finding
> > >> the message bundle does not help.
> > >> But I thought that has something to to with the classloader. I decided
> > >> to
> > >> place just the Extval libraries in the WEB-INF/lib directory. After
> that
> > >> Extval is finding my locale specific message bundle perfectly even
> > >> without
> > >> the hint in web.xml.
> > >> I know it is better to place all third party libs in WEB-INF/lib as of
> > >> class loading but during development redeploying the web app a lot of
> > >> times
> > >> gives problems with e.g. reloading Mojarra.
> > >>
> > >>
> > >> So that's a lot of text for few questions!
> > >>
> > >> I want to use Extval because of the flexible validation options. I
> hope
> > >> someone can answer my questions so I will better understand how to use
> > >> Extval?
> > >>
> > >> T.I.A.
> > >>
> > >> Johan Borchers
> >
> >
> >
>

Re: A few extval questions

Posted by Rudy De Busscher <rd...@gmail.com>.
Johan

Do I understand that if I use the DEACTIVATE_COMPONENT_
>
> INITIALIZATION with
> value true I do disable the JSF validation at all in favor of the ExtVal
> validation?


The other way around.  With that parameter set to true, ExtVal doesn't touch
the 'classic' attributes of the components in the tree like required and
maxLength.  So JSF validation runs unaltered, after the ExtVal validation.

But it is much better and easier to go ExtVal all the way.  If you have
custom JSF validators written, you can reuse them with the @Validator
annotation.

About the properties file, I'll try to recreate the situation and try to
find a solution.

Rudy


On 16 April 2010 14:52, Johan.borchers <jo...@solcon.nl> wrote:

> Hello Rudy and others.
>
> Thanks for the answers .
>
> Q1
> Disappearing of the field value with JSF validation only appears if I
> first submit the form with 3 invalid fields and the JSF validation is
> triggered. After that the field is not updated anymore by selecting a row
> from the list. Only after pushing the refresh button of the browser
> restores the normal behavior. Maybe it's also something of RichFaces
> because clicking on the list an refreshing the detail panel is done by
> AJAX.
>
> But if you say just go all the way with ExtVal than the problem will
> disappear.
> Oke if I do understand, the required attribute of JSF is never working
> because Extval overrides it.
> The other JSF validators should do their work but it's better to go all
> the way with Extval.
>
> Do I understand that if I use the DEACTIVATE_COMPONENT_INITIALIZATION with
> value true I do disable the JSF validation at all in favor of the ExtVal
> validation?
>
> Q2
> My Messages_nl_NL.properties file is my dutch replacement of the standard
> Messages_xx_XX.properties files delivered by Mojarra. I put this file in
> the default package (root) of my webapp classes.
>
> In the faces-config.xml file I have the following elements:
>  <locale-config>
>   <default-locale>nl_NL</default-locale>
>  </locale-config>
> and
>  <message-bundle>Messages</message-bundle>
>
> If I put the ExtVal libraries in the Tomcat lib directory Extval can't
> find the resource bundle.
> Even if I try to use the CUSTOM_MESSAGE_BUNDLE context-param to point to
> the messages bundle.
>
> After putting the ExtVal libraries in WEB-INF/lib my dutch messages are
> loaded even without setting the CUSTOM_MESSAGE_BUNDLE context-param.
>
> At this moment I'm not able to show this app in the internet.
> But it's a good idea to work on that because looking at the app is
> sometimes better than 1000 words.
>
> Regards Johan
>
> >Hi Johan,
> >
> >Q1
> >Yes, you can combine the JSF validation with ExtVal, like you already
> >found
> >out since you got 3 messages, 2 of extval and one of JSF.
> >Although, the idea is that you do everything with ExtVal.  You can use
> >@Length as a replacement for the f:validateLength tag.
> >
> >Except for the required attribute of the components. This required
> >attribute
> >is overwritten by the ExtVal code based on the annotations it find on the
> >property. (so when no annotations set, attribute shouldn't be altered)
> >
> >You can deactivate that behaviour by specifying the web context parameter
> >    <context-param>
> >
>
> ><param-name>org.apache.myfaces.extensions.validator.DEACTIVATE_COMPONENT_INITIALIZATION</param-name>
> >        <param-value>true</param-value>
> >    </context-param>
> >
> >You also loose then some functionality related to the validation of empty
> >fields (like specified in the JSF 2.0 spec for example
> >javax.faces.VALIDATE_EMPTY_FIELDS)
> >
> >The parameter can be of help about the problem of the value that
> >disappears.
> >I can't see any reason why the f:validateLength tag impacts the display of
> >the field value.  By using the web context parameter, we make sure the
> >annotation based bypass validation add-on can't interfere with the
> >encoding
> >of the page (and thus preventing the display of the field)
> >
> >I tried to recreate you problem with that but had no luck.
> >
> >Q2
> >This could be a classloading problem of Tomcat.
> >Which of the parameters in web.xml did you try,
> >JPA_VALIDATION_ERROR_MESSAGES or CUSTOM_MESSAGE_BUNDLE
> >
> >But you also say that, when ExtVal Libraries placed in WEB-INF/lib you
> >don't
> >need to specify any parameter and all messages are displayed correctly.
> >So
> >which messages have you placed in the properties file that are related to
> >ExtVal.
> >
> >Regards
> >Rudy.
> >
> >On 16 April 2010 08:52, Johan Borchers <jo...@solcon.nl> wrote:
> >
> >> Hello,
> >>
> >> I'm using Tomcat 6.0.20, Mojarra 1.2_14, RichFaces 3.3.3 and Extval
> >> 1.2.3
> >> on Mac en Windows with Java 1.6.0_17
> >> The Extval libs are:
> >> extval-annotation-based-bypass-validation-1.2.3.jar
> >> myfaces-extval-core-1.2.3.jar
> >> myfaces-extval-generic-support-1.2.3.jar
> >> myfaces-extval-property-validation-1.2.3.jar
> >>
> >> Extval is helping me al lot with bypass-validation because of fields in
> >> a
> >> form that perform looking up values.
> >> E.g. a manufacturer code field is required in the big picture. But the
> >> field is also performing an AJAX lookup of the manufacturer as you leave
> >> the
> >> field. At that moment it is legal to leave the field blank because you
> >> are
> >> just tabbing through your fields. So marking the lookup method with
> >> @BypassValidation(all = true) works perfect.
> >>
> >> Question 1 :
> >> Is it possible to use also the normal validation mechanism of JSF in
> >> combination with Extval?
> >>
> >> E.g I have 3 fields on a form with 2 fields having Extval @required
> >> validation and one field has the traditional validation property
> >> required="true" in the XHTML page.
> >> Sending the form with 3 blank fields gives me 2 faces messages back.
> >> Only
> >> the messages due to Extval validation.
> >> So for me it looks like Extval is disabling the JSF validation defined
> >> in
> >> the XHTML page.
> >>
> >> A little bit more strange is the behavior of the one field without
> >> Extval
> >> validation if I'm adding a validation to the field like
> >> <f:validateLength
> >> minimum="2" maximum="10"/>
> >> If I send the form with one character in the field and the 2 other
> >> fields
> >> are left blank I receive 3 faces messages (that's nice).
> >> And then after retrieving the records from the database showing up in a
> >> list clicking on the list fills normally all three fields in the form,
> >> but
> >> with the f:validateLength the field is left blank.
> >> Removing the f:validateLength from the field gives be back the normal
> >> behavior showing the data from the database.
> >>
> >>
> >> Question 2 :
> >> Where to place the Extval libraries?
> >>
> >> For developing I'm using 1 Tomcat installation per project. I do add all
> >> the libraries to the lib directory of Tomcat. Placing also the Extval
> >> libraries to this directory has a little problem.
> >> If i'm setting my locale to nl_NL and have a Messages_nl_NL.properties
> >> in
> >> my root package Mojarra will find it and Extval not. I do get the
> >> missing
> >> resource exception.
> >> Even using the special parameter in web.xml giving a hint to Extval
> >> finding
> >> the message bundle does not help.
> >> But I thought that has something to to with the classloader. I decided
> >> to
> >> place just the Extval libraries in the WEB-INF/lib directory. After that
> >> Extval is finding my locale specific message bundle perfectly even
> >> without
> >> the hint in web.xml.
> >> I know it is better to place all third party libs in WEB-INF/lib as of
> >> class loading but during development redeploying the web app a lot of
> >> times
> >> gives problems with e.g. reloading Mojarra.
> >>
> >>
> >> So that's a lot of text for few questions!
> >>
> >> I want to use Extval because of the flexible validation options. I hope
> >> someone can answer my questions so I will better understand how to use
> >> Extval?
> >>
> >> T.I.A.
> >>
> >> Johan Borchers
>
>
>

Re: A few extval questions

Posted by "Johan.borchers" <jo...@solcon.nl>.
Hello Rudy and others.

Thanks for the answers .

Q1
Disappearing of the field value with JSF validation only appears if I
first submit the form with 3 invalid fields and the JSF validation is
triggered. After that the field is not updated anymore by selecting a row
from the list. Only after pushing the refresh button of the browser
restores the normal behavior. Maybe it's also something of RichFaces
because clicking on the list an refreshing the detail panel is done by
AJAX.

But if you say just go all the way with ExtVal than the problem will
disappear.
Oke if I do understand, the required attribute of JSF is never working
because Extval overrides it.
The other JSF validators should do their work but it's better to go all
the way with Extval.

Do I understand that if I use the DEACTIVATE_COMPONENT_INITIALIZATION with
value true I do disable the JSF validation at all in favor of the ExtVal
validation?

Q2
My Messages_nl_NL.properties file is my dutch replacement of the standard
Messages_xx_XX.properties files delivered by Mojarra. I put this file in
the default package (root) of my webapp classes.

In the faces-config.xml file I have the following elements:
  <locale-config>
   <default-locale>nl_NL</default-locale>
  </locale-config>
and
  <message-bundle>Messages</message-bundle>

If I put the ExtVal libraries in the Tomcat lib directory Extval can't
find the resource bundle.
Even if I try to use the CUSTOM_MESSAGE_BUNDLE context-param to point to
the messages bundle.

After putting the ExtVal libraries in WEB-INF/lib my dutch messages are
loaded even without setting the CUSTOM_MESSAGE_BUNDLE context-param.

At this moment I'm not able to show this app in the internet.
But it's a good idea to work on that because looking at the app is
sometimes better than 1000 words.

Regards Johan

>Hi Johan,
>
>Q1
>Yes, you can combine the JSF validation with ExtVal, like you already
>found
>out since you got 3 messages, 2 of extval and one of JSF.
>Although, the idea is that you do everything with ExtVal.  You can use
>@Length as a replacement for the f:validateLength tag.
>
>Except for the required attribute of the components. This required
>attribute
>is overwritten by the ExtVal code based on the annotations it find on the
>property. (so when no annotations set, attribute shouldn't be altered)
>
>You can deactivate that behaviour by specifying the web context parameter
>    <context-param>
>
><param-name>org.apache.myfaces.extensions.validator.DEACTIVATE_COMPONENT_INITIALIZATION</param-name>
>        <param-value>true</param-value>
>    </context-param>
>
>You also loose then some functionality related to the validation of empty
>fields (like specified in the JSF 2.0 spec for example
>javax.faces.VALIDATE_EMPTY_FIELDS)
>
>The parameter can be of help about the problem of the value that
>disappears.
>I can't see any reason why the f:validateLength tag impacts the display of
>the field value.  By using the web context parameter, we make sure the
>annotation based bypass validation add-on can't interfere with the
>encoding
>of the page (and thus preventing the display of the field)
>
>I tried to recreate you problem with that but had no luck.
>
>Q2
>This could be a classloading problem of Tomcat.
>Which of the parameters in web.xml did you try,
>JPA_VALIDATION_ERROR_MESSAGES or CUSTOM_MESSAGE_BUNDLE
>
>But you also say that, when ExtVal Libraries placed in WEB-INF/lib you
>don't
>need to specify any parameter and all messages are displayed correctly.
>So
>which messages have you placed in the properties file that are related to
>ExtVal.
>
>Regards
>Rudy.
>
>On 16 April 2010 08:52, Johan Borchers <jo...@solcon.nl> wrote:
>
>> Hello,
>>
>> I'm using Tomcat 6.0.20, Mojarra 1.2_14, RichFaces 3.3.3 and Extval
>> 1.2.3
>> on Mac en Windows with Java 1.6.0_17
>> The Extval libs are:
>> extval-annotation-based-bypass-validation-1.2.3.jar
>> myfaces-extval-core-1.2.3.jar
>> myfaces-extval-generic-support-1.2.3.jar
>> myfaces-extval-property-validation-1.2.3.jar
>>
>> Extval is helping me al lot with bypass-validation because of fields in
>> a
>> form that perform looking up values.
>> E.g. a manufacturer code field is required in the big picture. But the
>> field is also performing an AJAX lookup of the manufacturer as you leave
>> the
>> field. At that moment it is legal to leave the field blank because you
>> are
>> just tabbing through your fields. So marking the lookup method with
>> @BypassValidation(all = true) works perfect.
>>
>> Question 1 :
>> Is it possible to use also the normal validation mechanism of JSF in
>> combination with Extval?
>>
>> E.g I have 3 fields on a form with 2 fields having Extval @required
>> validation and one field has the traditional validation property
>> required="true" in the XHTML page.
>> Sending the form with 3 blank fields gives me 2 faces messages back.
>> Only
>> the messages due to Extval validation.
>> So for me it looks like Extval is disabling the JSF validation defined
>> in
>> the XHTML page.
>>
>> A little bit more strange is the behavior of the one field without
>> Extval
>> validation if I'm adding a validation to the field like
>> <f:validateLength
>> minimum="2" maximum="10"/>
>> If I send the form with one character in the field and the 2 other
>> fields
>> are left blank I receive 3 faces messages (that's nice).
>> And then after retrieving the records from the database showing up in a
>> list clicking on the list fills normally all three fields in the form,
>> but
>> with the f:validateLength the field is left blank.
>> Removing the f:validateLength from the field gives be back the normal
>> behavior showing the data from the database.
>>
>>
>> Question 2 :
>> Where to place the Extval libraries?
>>
>> For developing I'm using 1 Tomcat installation per project. I do add all
>> the libraries to the lib directory of Tomcat. Placing also the Extval
>> libraries to this directory has a little problem.
>> If i'm setting my locale to nl_NL and have a Messages_nl_NL.properties
>> in
>> my root package Mojarra will find it and Extval not. I do get the
>> missing
>> resource exception.
>> Even using the special parameter in web.xml giving a hint to Extval
>> finding
>> the message bundle does not help.
>> But I thought that has something to to with the classloader. I decided
>> to
>> place just the Extval libraries in the WEB-INF/lib directory. After that
>> Extval is finding my locale specific message bundle perfectly even
>> without
>> the hint in web.xml.
>> I know it is better to place all third party libs in WEB-INF/lib as of
>> class loading but during development redeploying the web app a lot of
>> times
>> gives problems with e.g. reloading Mojarra.
>>
>>
>> So that's a lot of text for few questions!
>>
>> I want to use Extval because of the flexible validation options. I hope
>> someone can answer my questions so I will better understand how to use
>> Extval?
>>
>> T.I.A.
>>
>> Johan Borchers



Re: A few extval questions

Posted by Gerhard Petracek <ge...@gmail.com>.
hi johan,

the default error message key of the pattern annotation is: no_match
you can override the default message in your custom message bundle or you
can provide a custom key (or inline message)

{0} - {2} are the reserved placeholders for labels (if the placeholders
aren't used for other values).
in case of the pattern constraint {0} is used for the pattern itself.
-> in this case you can use {1} or {2} as placeholder for your label.

regards,
gerhard

http://www.irian.at

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

Professional Support for Apache MyFaces

2010/4/19 Johan Borchers <jo...@solcon.nl>

> Hello Werner and Rudy,
>
> Thanks for the answers!
>
> I did also some work to find a good solution for working with ExtVal.
> For me it is working now. I did find out that problems do appear on my
> Windows XP machine.
> On the Mac with Snow Leopard 10.6.3 things are working better. So let me
> explain what I did.
>
> I'm working with Eclipse Galileo 3.5.2 JEE with JBoss VE plugin for
> RichFaces on both the Mac and Windows XP.
> Both systems are running Java 1.6.0_17. Also on both systems I have Tomcat
> 6.0.20.
> For deployment only I use an Ubuntu 9.10 machine with Tomcat 6.0.20 and
> OpenJDK 6.
>
> For development I do start or debug Tomcat in Eclipse.
> I do build the war file with Ant and deploy it to the webapps directory of
> Tomcat.
> Tomcat redeploys (and unpacks) the webpapp after adding the war file to the
> webapps directory.
>
> Now I only have the MySQL driver software in the lib directory of Tomcat.
> The rest of the libraries I now do have in the WEB-INF/lib directory of the
> webapp.
> The following is a list of my files in the WEB-INF/lib directory:
>
> asm-3.2.jar
> cglib-2.2.jar
> commons-beanutils-1.8.0.jar
> commons-collections-3.2.1.jar
> commons-digester-1.8.jar
> commons-lang-2.4.jar
> commons-logging-1.1.1.jar
> extval-annotation-based-bypass-validation-1.2.3.jar
> ibatis-2.3.4.726.jar
> jsf-api-mojarra-1.2_14-b01.jar
> jsf-facelets-1.1.15.B1.jar
> jsf-impl-mojarra-1.2_14-b01.jar
> jstl-1.2.jar
> myfaces-extval-core-1.2.3.jar
> myfaces-extval-generic-support-1.2.3.jar
> myfaces-extval-property-validation-1.2.3.jar
> richfaces-api-3.3.3.Final.jar
> richfaces-impl-3.3.3.Final.jar
> richfaces-ui-3.3.3.Final.jar
>
> Now on Windows with Tomcat 6.0.20 redeploying the webapp hangs on
> Undeploying.
> At least that's the last message on the console.
>
> The same configuration on the Mac works perfectly fine. No problem with
> redeploying the webapp to a running Tomcat engine.
> It just onloads the old webapp and reloads the new webapp.
>
> I downloaded the Tomcat 6.0.26 32 bit version for Windows, configured it
> the same as 6.0.20 and redeploying works also fine on Windows.
> But only if I start Tomcat from the command line via catalina.bat.
> Starting Tomcat from Eclipse did still hang on redeploying also for Tomcat
> 6.0.26.
> Then I searched for the difference between starting Tomcat from the command
> line and starting Tomcat in Eclipse.
> Eclipse is just using the Bootstrap.jar and passing parameters where the
> catalina.bat defines a lot more defaults.
> I added the 2 vm parameters for configuring Tomcat JULI logging from the
> catalina.bat to the startup parameters where Eclipse starts Tomcat.
> Because Tomcat was not logging anything when started from Eclipse.
> And guess what, redeploying the webapp to Tomcat 6.0.26 running in Eclipse
> works also fine.
>
> Redeploying on on the Mac looks more robust than on Windows. On the Mac it
> also works for Tomcat 6.0.20.
> I still don't know the real reason why the webapp won't unload on Windows
> with Tomcat 6.0.20 but I have a workaround.
>
> I'm able to go all the way with ExtVal because until now I did not add any
> JSF validation to the webapp.
> With the bypass annotation I'm able to build behavior of our desktop
> applications in the webapp.
> I also like the @Pattern annotation.
>
> Q3
>
> I now have my translated messages in the file Messages_nl_NL.properties.
> Extval is showing the Dutch messages. But for the Pattern annotation it
> gives an English message like "Invalid format". Where can I translate these
> messages and do they also use the label of the UI object?
>
>
> Regards,
>
> Johan
>
>
>
> On Apr 19, 2010, at 4:45 PM, Werner Punz wrote:
>
> > Ok I did some initial testing, Ext-Val + MyFaces Ext-Scripting works
> > but the dynamic reloading only works for constraints,
> > Validation group reloading does not work yet, due to caching
> > on Ext-Vals side as it seems.
> > I will work with Gerhard on this issue to resolve
> > it in the near future, but if you can live with what is there
> > either use JSF2s bean validation support or do the occasional restart if
> you need to alter the Validation group settings.
> >
> > Werner
> >
> >
> > Am 16.04.10 13:38, schrieb Werner Punz:
> >> Am 16.04.10 13:16, schrieb Gerhard Petracek:
> >>> hi johan,
> >>>
> >>> some additions:
> >>> as mentioned by rudy: the "required"-attribute is quite special in
> >>> combination with component initialization. i'll add some information
> >>> about
> >>> it in our new wiki. concerning your concrete issues: it would be nice
> >>> if you
> >>> can provide a link to a small demo app which illustrates the issue (to
> >>> ensure that we are talking about the same details).
> >>>
> >>>> Where to place the Extval libraries?
> >>>
> >>> you could customize it via a custom message resolver.
> >>> as alternative you could use myfaces-core + ext-scripting - so you
> don't
> >>> have to restart tomcat...
> >>>
> >> Well I have not tested the combo yet, I wanted to do it this week but
> >> haven´t found enough time, but feel free to try ext-scripting in that
> >> combination, but I cannot gurantee that it works, not before next week
> >> before the final testing round before 1.0, as long as you stay on the
> >> JSF side it can help you to save a lot of restarts.
> >>
> >> Alternatively you can use jRebel to avoid restarts.
> >>
> >> Here is the info regarding ext-scripting (no official site yet)
> >> http://people.apache.org/~werpu/ext-script-site/ I highly recommend
> >> to make a checkout and build, the last beta had some serious bugs which
> >> I fixed in between.
> >> Have in mind Ext-Scripting currently only works on MyFaces not on
> >> Mojarra, Mojarra support will be added but is not on the TODO list
> >> for 1.0, also additional framework support is in the works but will
> >> not be in 1.0.
> >>
> >> Here is the info regarding jRebel:
> >> http://www.zeroturnaround.com/
> >>
> >>
> >> Werner
> >>
> >>
> >
> >
>
>

Re: A few extval questions

Posted by Werner Punz <we...@gmail.com>.
Ok just to add another message here, I just added the missing cache 
clearing support for Ext-Val into ext-scripting trunk at least the demo 
now works for me I can change validation groups, and constraints on the 
fly without server restart.

Sorry to push this message into this thread but since it is also restart 
related.
For anyone who does not know what Ext-Scripting is:

http://people.apache.org/~werpu/ext-script-site/

There is no official release yet, but we are getting close to 1.0

Werner


Am 20.04.10 09:45, schrieb Werner Punz:
> Actually regarding to redeploying, you run into a typical Windows
> problem here.
> Redeploying and Windows still is an issue. The reason for this is
> Windows does pessimistic filelocking which Unixoid systems generally do
> not do.
>
> Tomcat bypasses the problem to some extent by mirroring and starting the
> installation from a temp dir in its local directory instead of using
> the official webapp dir. (So every redeploy gets its own shadow directory)
>
> Seems like the WTP has disabled this for whatever reason (I assume, a
> bug) and adding the parameter has enabled it again.
> As you said the whole redeploying is less flakey on OSX, due to the fact
> that OSX as every Unix system (After all OSX is a NextStep derivate,
> which is a Mach-BSD Kernel Hybrid with OO libraries on top of it) does
> not lock files at all but instead relies on an optimistic locking
> mechanism via .lock files.
> Hence redeployment directly happens on your webapp directory instead of
> copying and running it from a shadow directory, due to the fact that
> the files are not locked on OS level.
>
> It is as simple and as complicated as that. My personal experience is
> that 90% of all problems especially in the Eclipse area in Windows are
> caused by the pessimistic file locking.
>
> Werner
>
>
> Am 19.04.10 22:37, schrieb Johan Borchers:
>> Hello Werner and Rudy,
>>
>> Thanks for the answers!
>>
>> I did also some work to find a good solution for working with ExtVal.
>> For me it is working now. I did find out that problems do appear on my
>> Windows XP machine.
>> On the Mac with Snow Leopard 10.6.3 things are working better. So let
>> me explain what I did.
>>
>> I'm working with Eclipse Galileo 3.5.2 JEE with JBoss VE plugin for
>> RichFaces on both the Mac and Windows XP.
>> Both systems are running Java 1.6.0_17. Also on both systems I have
>> Tomcat 6.0.20.
>> For deployment only I use an Ubuntu 9.10 machine with Tomcat 6.0.20
>> and OpenJDK 6.
>>
>> For development I do start or debug Tomcat in Eclipse.
>> I do build the war file with Ant and deploy it to the webapps
>> directory of Tomcat.
>> Tomcat redeploys (and unpacks) the webpapp after adding the war file
>> to the webapps directory.
>>
>> Now I only have the MySQL driver software in the lib directory of Tomcat.
>> The rest of the libraries I now do have in the WEB-INF/lib directory
>> of the webapp.
>> The following is a list of my files in the WEB-INF/lib directory:
>>
>> asm-3.2.jar
>> cglib-2.2.jar
>> commons-beanutils-1.8.0.jar
>> commons-collections-3.2.1.jar
>> commons-digester-1.8.jar
>> commons-lang-2.4.jar
>> commons-logging-1.1.1.jar
>> extval-annotation-based-bypass-validation-1.2.3.jar
>> ibatis-2.3.4.726.jar
>> jsf-api-mojarra-1.2_14-b01.jar
>> jsf-facelets-1.1.15.B1.jar
>> jsf-impl-mojarra-1.2_14-b01.jar
>> jstl-1.2.jar
>> myfaces-extval-core-1.2.3.jar
>> myfaces-extval-generic-support-1.2.3.jar
>> myfaces-extval-property-validation-1.2.3.jar
>> richfaces-api-3.3.3.Final.jar
>> richfaces-impl-3.3.3.Final.jar
>> richfaces-ui-3.3.3.Final.jar
>>
>> Now on Windows with Tomcat 6.0.20 redeploying the webapp hangs on
>> Undeploying.
>> At least that's the last message on the console.
>>
>> The same configuration on the Mac works perfectly fine. No problem
>> with redeploying the webapp to a running Tomcat engine.
>> It just onloads the old webapp and reloads the new webapp.
>>
>> I downloaded the Tomcat 6.0.26 32 bit version for Windows, configured
>> it the same as 6.0.20 and redeploying works also fine on Windows.
>> But only if I start Tomcat from the command line via catalina.bat.
>> Starting Tomcat from Eclipse did still hang on redeploying also for
>> Tomcat 6.0.26.
>> Then I searched for the difference between starting Tomcat from the
>> command line and starting Tomcat in Eclipse.
>> Eclipse is just using the Bootstrap.jar and passing parameters where
>> the catalina.bat defines a lot more defaults.
>> I added the 2 vm parameters for configuring Tomcat JULI logging from
>> the catalina.bat to the startup parameters where Eclipse starts Tomcat.
>> Because Tomcat was not logging anything when started from Eclipse.
>> And guess what, redeploying the webapp to Tomcat 6.0.26 running in
>> Eclipse works also fine.
>>
>> Redeploying on on the Mac looks more robust than on Windows. On the
>> Mac it also works for Tomcat 6.0.20.
>> I still don't know the real reason why the webapp won't unload on
>> Windows with Tomcat 6.0.20 but I have a workaround.
>>
>> I'm able to go all the way with ExtVal because until now I did not add
>> any JSF validation to the webapp.
>> With the bypass annotation I'm able to build behavior of our desktop
>> applications in the webapp.
>> I also like the @Pattern annotation.
>>
>> Q3
>>
>> I now have my translated messages in the file
>> Messages_nl_NL.properties. Extval is showing the Dutch messages. But
>> for the Pattern annotation it gives an English message like "Invalid
>> format". Where can I translate these messages and do they also use the
>> label of the UI object?
>>
>>
>> Regards,
>>
>> Johan
>>
>>
>>
>> On Apr 19, 2010, at 4:45 PM, Werner Punz wrote:
>>
>>> Ok I did some initial testing, Ext-Val + MyFaces Ext-Scripting works
>>> but the dynamic reloading only works for constraints,
>>> Validation group reloading does not work yet, due to caching
>>> on Ext-Vals side as it seems.
>>> I will work with Gerhard on this issue to resolve
>>> it in the near future, but if you can live with what is there
>>> either use JSF2s bean validation support or do the occasional restart
>>> if you need to alter the Validation group settings.
>>>
>>> Werner
>>>
>>>
>>> Am 16.04.10 13:38, schrieb Werner Punz:
>>>> Am 16.04.10 13:16, schrieb Gerhard Petracek:
>>>>> hi johan,
>>>>>
>>>>> some additions:
>>>>> as mentioned by rudy: the "required"-attribute is quite special in
>>>>> combination with component initialization. i'll add some information
>>>>> about
>>>>> it in our new wiki. concerning your concrete issues: it would be nice
>>>>> if you
>>>>> can provide a link to a small demo app which illustrates the issue (to
>>>>> ensure that we are talking about the same details).
>>>>>
>>>>>> Where to place the Extval libraries?
>>>>>
>>>>> you could customize it via a custom message resolver.
>>>>> as alternative you could use myfaces-core + ext-scripting - so you
>>>>> don't
>>>>> have to restart tomcat...
>>>>>
>>>> Well I have not tested the combo yet, I wanted to do it this week but
>>>> haven´t found enough time, but feel free to try ext-scripting in that
>>>> combination, but I cannot gurantee that it works, not before next week
>>>> before the final testing round before 1.0, as long as you stay on the
>>>> JSF side it can help you to save a lot of restarts.
>>>>
>>>> Alternatively you can use jRebel to avoid restarts.
>>>>
>>>> Here is the info regarding ext-scripting (no official site yet)
>>>> http://people.apache.org/~werpu/ext-script-site/ I highly recommend
>>>> to make a checkout and build, the last beta had some serious bugs which
>>>> I fixed in between.
>>>> Have in mind Ext-Scripting currently only works on MyFaces not on
>>>> Mojarra, Mojarra support will be added but is not on the TODO list
>>>> for 1.0, also additional framework support is in the works but will
>>>> not be in 1.0.
>>>>
>>>> Here is the info regarding jRebel:
>>>> http://www.zeroturnaround.com/
>>>>
>>>>
>>>> Werner
>>>>
>>>>
>>>
>>>
>>
>>
>
>
>



Re: A few extval questions

Posted by Werner Punz <we...@gmail.com>.
Actually regarding to redeploying, you run into a typical Windows 
problem here.
Redeploying and Windows still is an issue. The reason for this is 
Windows does pessimistic filelocking which Unixoid systems generally do 
not do.

Tomcat bypasses the problem to some extent by mirroring and starting the 
installation from a temp dir in its local directory instead of using
the official webapp dir. (So every redeploy gets its own shadow directory)

Seems like the WTP has disabled this for whatever reason (I assume, a 
bug) and adding the parameter has enabled it again.
As you said the whole redeploying is less flakey on OSX, due to the fact
that OSX as every Unix system (After all OSX is a NextStep derivate, 
which is a Mach-BSD Kernel Hybrid with OO libraries on top of it) does 
not lock files at all but instead relies on an optimistic locking 
mechanism via .lock files.
Hence redeployment directly happens on your webapp directory instead of 
copying and running it from a shadow directory, due to the fact that
the files are not locked on OS level.

It is as simple and as complicated as that. My personal experience is
that 90% of all problems especially in the Eclipse area in Windows are
caused by the pessimistic file locking.

Werner


Am 19.04.10 22:37, schrieb Johan Borchers:
> Hello Werner and Rudy,
>
> Thanks for the answers!
>
> I did also some work to find a good solution for working with ExtVal.
> For me it is working now. I did find out that problems do appear on my Windows XP machine.
> On the Mac with Snow Leopard 10.6.3 things are working better. So let me explain what I did.
>
> I'm working with Eclipse Galileo 3.5.2 JEE with JBoss VE plugin for RichFaces on both the Mac and Windows XP.
> Both systems are running Java 1.6.0_17. Also on both systems I have Tomcat 6.0.20.
> For deployment only I use an Ubuntu 9.10 machine with Tomcat 6.0.20 and OpenJDK 6.
>
> For development I do start or debug Tomcat in Eclipse.
> I do build the war file with Ant and deploy it to the webapps directory of Tomcat.
> Tomcat redeploys (and unpacks) the webpapp after adding the war file to the webapps directory.
>
> Now I only have the MySQL driver software in the lib directory of Tomcat.
> The rest of the libraries I now do have in the WEB-INF/lib directory of the webapp.
> The following is a list of my files in the WEB-INF/lib directory:
>
> asm-3.2.jar
> cglib-2.2.jar
> commons-beanutils-1.8.0.jar
> commons-collections-3.2.1.jar
> commons-digester-1.8.jar
> commons-lang-2.4.jar
> commons-logging-1.1.1.jar
> extval-annotation-based-bypass-validation-1.2.3.jar
> ibatis-2.3.4.726.jar
> jsf-api-mojarra-1.2_14-b01.jar
> jsf-facelets-1.1.15.B1.jar
> jsf-impl-mojarra-1.2_14-b01.jar
> jstl-1.2.jar
> myfaces-extval-core-1.2.3.jar
> myfaces-extval-generic-support-1.2.3.jar
> myfaces-extval-property-validation-1.2.3.jar
> richfaces-api-3.3.3.Final.jar
> richfaces-impl-3.3.3.Final.jar
> richfaces-ui-3.3.3.Final.jar
>
> Now on Windows with Tomcat 6.0.20 redeploying the webapp hangs on Undeploying.
> At least that's the last message on the console.
>
> The same configuration on the Mac works perfectly fine. No problem with redeploying the webapp to a running Tomcat engine.
> It just onloads the old webapp and reloads the new webapp.
>
> I downloaded the Tomcat 6.0.26 32 bit version for Windows, configured it the same as 6.0.20 and redeploying works also fine on Windows.
> But only if I start Tomcat from the command line via catalina.bat.
> Starting Tomcat from Eclipse did still hang on redeploying also for Tomcat 6.0.26.
> Then I searched for the difference between starting Tomcat from the command line and starting Tomcat in Eclipse.
> Eclipse is just using the Bootstrap.jar and passing parameters where the catalina.bat defines a lot more defaults.
> I added the 2 vm parameters for configuring Tomcat JULI logging from the catalina.bat to the startup parameters where Eclipse starts Tomcat.
> Because Tomcat was not logging anything when started from Eclipse.
> And guess what, redeploying the webapp to Tomcat 6.0.26 running in Eclipse works also fine.
>
> Redeploying on on the Mac looks more robust than on Windows. On the Mac it also works for Tomcat 6.0.20.
> I still don't know the real reason why the webapp won't unload on Windows with Tomcat 6.0.20 but I have a workaround.
>
> I'm able to go all the way with ExtVal because until now I did not add any JSF validation to the webapp.
> With the bypass annotation I'm able to build behavior of our desktop applications in the webapp.
> I also like the @Pattern annotation.
>
> Q3
>
> I now have my translated messages in the file Messages_nl_NL.properties. Extval is showing the Dutch messages. But for the Pattern annotation it gives an English message like "Invalid format". Where can I translate these messages and do they also use the label of the UI object?
>
>
> Regards,
>
> Johan
>
>
>
> On Apr 19, 2010, at 4:45 PM, Werner Punz wrote:
>
>> Ok I did some initial testing, Ext-Val + MyFaces Ext-Scripting works
>> but the dynamic reloading only works for constraints,
>> Validation group reloading does not work yet, due to caching
>> on Ext-Vals side as it seems.
>> I will work with Gerhard on this issue to resolve
>> it in the near future, but if you can live with what is there
>> either use JSF2s bean validation support or do the occasional restart if you need to alter the Validation group settings.
>>
>> Werner
>>
>>
>> Am 16.04.10 13:38, schrieb Werner Punz:
>>> Am 16.04.10 13:16, schrieb Gerhard Petracek:
>>>> hi johan,
>>>>
>>>> some additions:
>>>> as mentioned by rudy: the "required"-attribute is quite special in
>>>> combination with component initialization. i'll add some information
>>>> about
>>>> it in our new wiki. concerning your concrete issues: it would be nice
>>>> if you
>>>> can provide a link to a small demo app which illustrates the issue (to
>>>> ensure that we are talking about the same details).
>>>>
>>>>> Where to place the Extval libraries?
>>>>
>>>> you could customize it via a custom message resolver.
>>>> as alternative you could use myfaces-core + ext-scripting - so you don't
>>>> have to restart tomcat...
>>>>
>>> Well I have not tested the combo yet, I wanted to do it this week but
>>> haven´t found enough time, but feel free to try ext-scripting in that
>>> combination, but I cannot gurantee that it works, not before next week
>>> before the final testing round before 1.0, as long as you stay on the
>>> JSF side it can help you to save a lot of restarts.
>>>
>>> Alternatively you can use jRebel to avoid restarts.
>>>
>>> Here is the info regarding ext-scripting (no official site yet)
>>> http://people.apache.org/~werpu/ext-script-site/ I highly recommend
>>> to make a checkout and build, the last beta had some serious bugs which
>>> I fixed in between.
>>> Have in mind Ext-Scripting currently only works on MyFaces not on
>>> Mojarra, Mojarra support will be added but is not on the TODO list
>>> for 1.0, also additional framework support is in the works but will
>>> not be in 1.0.
>>>
>>> Here is the info regarding jRebel:
>>> http://www.zeroturnaround.com/
>>>
>>>
>>> Werner
>>>
>>>
>>
>>
>
>



Re: A few extval questions

Posted by Johan Borchers <jo...@solcon.nl>.
Hello Werner and Rudy,

Thanks for the answers!

I did also some work to find a good solution for working with ExtVal.
For me it is working now. I did find out that problems do appear on my Windows XP machine.
On the Mac with Snow Leopard 10.6.3 things are working better. So let me explain what I did.

I'm working with Eclipse Galileo 3.5.2 JEE with JBoss VE plugin for RichFaces on both the Mac and Windows XP.
Both systems are running Java 1.6.0_17. Also on both systems I have Tomcat 6.0.20.
For deployment only I use an Ubuntu 9.10 machine with Tomcat 6.0.20 and OpenJDK 6.

For development I do start or debug Tomcat in Eclipse.
I do build the war file with Ant and deploy it to the webapps directory of Tomcat.
Tomcat redeploys (and unpacks) the webpapp after adding the war file to the webapps directory.

Now I only have the MySQL driver software in the lib directory of Tomcat.
The rest of the libraries I now do have in the WEB-INF/lib directory of the webapp.
The following is a list of my files in the WEB-INF/lib directory:

asm-3.2.jar
cglib-2.2.jar
commons-beanutils-1.8.0.jar
commons-collections-3.2.1.jar
commons-digester-1.8.jar
commons-lang-2.4.jar
commons-logging-1.1.1.jar
extval-annotation-based-bypass-validation-1.2.3.jar
ibatis-2.3.4.726.jar
jsf-api-mojarra-1.2_14-b01.jar
jsf-facelets-1.1.15.B1.jar
jsf-impl-mojarra-1.2_14-b01.jar
jstl-1.2.jar
myfaces-extval-core-1.2.3.jar
myfaces-extval-generic-support-1.2.3.jar
myfaces-extval-property-validation-1.2.3.jar
richfaces-api-3.3.3.Final.jar
richfaces-impl-3.3.3.Final.jar
richfaces-ui-3.3.3.Final.jar

Now on Windows with Tomcat 6.0.20 redeploying the webapp hangs on Undeploying.
At least that's the last message on the console.

The same configuration on the Mac works perfectly fine. No problem with redeploying the webapp to a running Tomcat engine.
It just onloads the old webapp and reloads the new webapp.

I downloaded the Tomcat 6.0.26 32 bit version for Windows, configured it the same as 6.0.20 and redeploying works also fine on Windows.
But only if I start Tomcat from the command line via catalina.bat.
Starting Tomcat from Eclipse did still hang on redeploying also for Tomcat 6.0.26.
Then I searched for the difference between starting Tomcat from the command line and starting Tomcat in Eclipse.
Eclipse is just using the Bootstrap.jar and passing parameters where the catalina.bat defines a lot more defaults.
I added the 2 vm parameters for configuring Tomcat JULI logging from the catalina.bat to the startup parameters where Eclipse starts Tomcat.
Because Tomcat was not logging anything when started from Eclipse.
And guess what, redeploying the webapp to Tomcat 6.0.26 running in Eclipse works also fine.

Redeploying on on the Mac looks more robust than on Windows. On the Mac it also works for Tomcat 6.0.20.
I still don't know the real reason why the webapp won't unload on Windows with Tomcat 6.0.20 but I have a workaround.

I'm able to go all the way with ExtVal because until now I did not add any JSF validation to the webapp.
With the bypass annotation I'm able to build behavior of our desktop applications in the webapp.
I also like the @Pattern annotation.  

Q3

I now have my translated messages in the file Messages_nl_NL.properties. Extval is showing the Dutch messages. But for the Pattern annotation it gives an English message like "Invalid format". Where can I translate these messages and do they also use the label of the UI object?


Regards,

Johan



On Apr 19, 2010, at 4:45 PM, Werner Punz wrote:

> Ok I did some initial testing, Ext-Val + MyFaces Ext-Scripting works
> but the dynamic reloading only works for constraints,
> Validation group reloading does not work yet, due to caching
> on Ext-Vals side as it seems.
> I will work with Gerhard on this issue to resolve
> it in the near future, but if you can live with what is there
> either use JSF2s bean validation support or do the occasional restart if you need to alter the Validation group settings.
> 
> Werner
> 
> 
> Am 16.04.10 13:38, schrieb Werner Punz:
>> Am 16.04.10 13:16, schrieb Gerhard Petracek:
>>> hi johan,
>>> 
>>> some additions:
>>> as mentioned by rudy: the "required"-attribute is quite special in
>>> combination with component initialization. i'll add some information
>>> about
>>> it in our new wiki. concerning your concrete issues: it would be nice
>>> if you
>>> can provide a link to a small demo app which illustrates the issue (to
>>> ensure that we are talking about the same details).
>>> 
>>>> Where to place the Extval libraries?
>>> 
>>> you could customize it via a custom message resolver.
>>> as alternative you could use myfaces-core + ext-scripting - so you don't
>>> have to restart tomcat...
>>> 
>> Well I have not tested the combo yet, I wanted to do it this week but
>> haven´t found enough time, but feel free to try ext-scripting in that
>> combination, but I cannot gurantee that it works, not before next week
>> before the final testing round before 1.0, as long as you stay on the
>> JSF side it can help you to save a lot of restarts.
>> 
>> Alternatively you can use jRebel to avoid restarts.
>> 
>> Here is the info regarding ext-scripting (no official site yet)
>> http://people.apache.org/~werpu/ext-script-site/ I highly recommend
>> to make a checkout and build, the last beta had some serious bugs which
>> I fixed in between.
>> Have in mind Ext-Scripting currently only works on MyFaces not on
>> Mojarra, Mojarra support will be added but is not on the TODO list
>> for 1.0, also additional framework support is in the works but will
>> not be in 1.0.
>> 
>> Here is the info regarding jRebel:
>> http://www.zeroturnaround.com/
>> 
>> 
>> Werner
>> 
>> 
> 
> 


Re: A few extval questions

Posted by Werner Punz <we...@gmail.com>.
Ok I did some initial testing, Ext-Val + MyFaces Ext-Scripting works
but the dynamic reloading only works for constraints,
Validation group reloading does not work yet, due to caching
on Ext-Vals side as it seems.
I will work with Gerhard on this issue to resolve
it in the near future, but if you can live with what is there
either use JSF2s bean validation support or do the occasional restart if 
you need to alter the Validation group settings.

Werner


Am 16.04.10 13:38, schrieb Werner Punz:
> Am 16.04.10 13:16, schrieb Gerhard Petracek:
>> hi johan,
>>
>> some additions:
>> as mentioned by rudy: the "required"-attribute is quite special in
>> combination with component initialization. i'll add some information
>> about
>> it in our new wiki. concerning your concrete issues: it would be nice
>> if you
>> can provide a link to a small demo app which illustrates the issue (to
>> ensure that we are talking about the same details).
>>
>>> Where to place the Extval libraries?
>>
>> you could customize it via a custom message resolver.
>> as alternative you could use myfaces-core + ext-scripting - so you don't
>> have to restart tomcat...
>>
> Well I have not tested the combo yet, I wanted to do it this week but
> haven´t found enough time, but feel free to try ext-scripting in that
> combination, but I cannot gurantee that it works, not before next week
> before the final testing round before 1.0, as long as you stay on the
> JSF side it can help you to save a lot of restarts.
>
> Alternatively you can use jRebel to avoid restarts.
>
> Here is the info regarding ext-scripting (no official site yet)
> http://people.apache.org/~werpu/ext-script-site/ I highly recommend
> to make a checkout and build, the last beta had some serious bugs which
> I fixed in between.
> Have in mind Ext-Scripting currently only works on MyFaces not on
> Mojarra, Mojarra support will be added but is not on the TODO list
> for 1.0, also additional framework support is in the works but will
> not be in 1.0.
>
> Here is the info regarding jRebel:
> http://www.zeroturnaround.com/
>
>
> Werner
>
>



Re: A few extval questions

Posted by Werner Punz <we...@gmail.com>.
Am 16.04.10 13:16, schrieb Gerhard Petracek:
> hi johan,
>
> some additions:
> as mentioned by rudy: the "required"-attribute is quite special in
> combination with component initialization. i'll add some information about
> it in our new wiki. concerning your concrete issues: it would be nice if you
> can provide a link to a small demo app which illustrates the issue (to
> ensure that we are talking about the same details).
>
>> Where to place the Extval libraries?
>
> you could customize it via a custom message resolver.
> as alternative you could use myfaces-core + ext-scripting - so you don't
> have to restart tomcat...
>
Well I have not tested the combo yet, I wanted to do it this week but 
haven´t found enough time, but feel free to try ext-scripting in that 
combination, but I cannot gurantee that it works, not before next week 
before the final testing round before 1.0, as long as you stay on the 
JSF side it can help you to save a lot of restarts.

Alternatively you can use jRebel to avoid restarts.

Here is the info regarding ext-scripting (no official site yet)
http://people.apache.org/~werpu/ext-script-site/ I highly recommend
to make a checkout and build, the last beta had some serious bugs which 
I fixed in between.
Have in mind Ext-Scripting currently only works on MyFaces not on 
Mojarra, Mojarra support will be added but is not on the TODO list
for 1.0, also additional framework support is in the works but will
not be in 1.0.

Here is the info regarding jRebel:
http://www.zeroturnaround.com/


Werner


Re: A few extval questions

Posted by Gerhard Petracek <ge...@gmail.com>.
hi johan,

some additions:
as mentioned by rudy: the "required"-attribute is quite special in
combination with component initialization. i'll add some information about
it in our new wiki. concerning your concrete issues: it would be nice if you
can provide a link to a small demo app which illustrates the issue (to
ensure that we are talking about the same details).

> Where to place the Extval libraries?

you could customize it via a custom message resolver.
as alternative you could use myfaces-core + ext-scripting - so you don't
have to restart tomcat...

regards,
gerhard

http://www.irian.at

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

Professional Support for Apache MyFaces


2010/4/16 Rudy De Busscher <rd...@gmail.com>

> Hi Johan,
>
> Q1
> Yes, you can combine the JSF validation with ExtVal, like you already found
> out since you got 3 messages, 2 of extval and one of JSF.
> Although, the idea is that you do everything with ExtVal.  You can use
> @Length as a replacement for the f:validateLength tag.
>
> Except for the required attribute of the components. This required
> attribute
> is overwritten by the ExtVal code based on the annotations it find on the
> property. (so when no annotations set, attribute shouldn't be altered)
>
> You can deactivate that behaviour by specifying the web context parameter
>    <context-param>
>
>
> <param-name>org.apache.myfaces.extensions.validator.DEACTIVATE_COMPONENT_INITIALIZATION</param-name>
>        <param-value>true</param-value>
>    </context-param>
>
> You also loose then some functionality related to the validation of empty
> fields (like specified in the JSF 2.0 spec for example
> javax.faces.VALIDATE_EMPTY_FIELDS)
>
> The parameter can be of help about the problem of the value that
> disappears.
> I can't see any reason why the f:validateLength tag impacts the display of
> the field value.  By using the web context parameter, we make sure the
> annotation based bypass validation add-on can't interfere with the encoding
> of the page (and thus preventing the display of the field)
>
> I tried to recreate you problem with that but had no luck.
>
> Q2
> This could be a classloading problem of Tomcat.
> Which of the parameters in web.xml did you try,
> JPA_VALIDATION_ERROR_MESSAGES or CUSTOM_MESSAGE_BUNDLE
>
> But you also say that, when ExtVal Libraries placed in WEB-INF/lib you
> don't
> need to specify any parameter and all messages are displayed correctly.  So
> which messages have you placed in the properties file that are related to
> ExtVal.
>
> Regards
> Rudy.
>
> On 16 April 2010 08:52, Johan Borchers <jo...@solcon.nl> wrote:
>
> > Hello,
> >
> > I'm using Tomcat 6.0.20, Mojarra 1.2_14, RichFaces 3.3.3 and Extval 1.2.3
> > on Mac en Windows with Java 1.6.0_17
> > The Extval libs are:
> > extval-annotation-based-bypass-validation-1.2.3.jar
> > myfaces-extval-core-1.2.3.jar
> > myfaces-extval-generic-support-1.2.3.jar
> > myfaces-extval-property-validation-1.2.3.jar
> >
> > Extval is helping me al lot with bypass-validation because of fields in a
> > form that perform looking up values.
> > E.g. a manufacturer code field is required in the big picture. But the
> > field is also performing an AJAX lookup of the manufacturer as you leave
> the
> > field. At that moment it is legal to leave the field blank because you
> are
> > just tabbing through your fields. So marking the lookup method with
> > @BypassValidation(all = true) works perfect.
> >
> > Question 1 :
> > Is it possible to use also the normal validation mechanism of JSF in
> > combination with Extval?
> >
> > E.g I have 3 fields on a form with 2 fields having Extval @required
> > validation and one field has the traditional validation property
> > required="true" in the XHTML page.
> > Sending the form with 3 blank fields gives me 2 faces messages back. Only
> > the messages due to Extval validation.
> > So for me it looks like Extval is disabling the JSF validation defined in
> > the XHTML page.
> >
> > A little bit more strange is the behavior of the one field without Extval
> > validation if I'm adding a validation to the field like <f:validateLength
> > minimum="2" maximum="10"/>
> > If I send the form with one character in the field and the 2 other fields
> > are left blank I receive 3 faces messages (that's nice).
> > And then after retrieving the records from the database showing up in a
> > list clicking on the list fills normally all three fields in the form,
> but
> > with the f:validateLength the field is left blank.
> > Removing the f:validateLength from the field gives be back the normal
> > behavior showing the data from the database.
> >
> >
> > Question 2 :
> > Where to place the Extval libraries?
> >
> > For developing I'm using 1 Tomcat installation per project. I do add all
> > the libraries to the lib directory of Tomcat. Placing also the Extval
> > libraries to this directory has a little problem.
> > If i'm setting my locale to nl_NL and have a Messages_nl_NL.properties in
> > my root package Mojarra will find it and Extval not. I do get the missing
> > resource exception.
> > Even using the special parameter in web.xml giving a hint to Extval
> finding
> > the message bundle does not help.
> > But I thought that has something to to with the classloader. I decided to
> > place just the Extval libraries in the WEB-INF/lib directory. After that
> > Extval is finding my locale specific message bundle perfectly even
> without
> > the hint in web.xml.
> > I know it is better to place all third party libs in WEB-INF/lib as of
> > class loading but during development redeploying the web app a lot of
> times
> > gives problems with e.g. reloading Mojarra.
> >
> >
> > So that's a lot of text for few questions!
> >
> > I want to use Extval because of the flexible validation options. I hope
> > someone can answer my questions so I will better understand how to use
> > Extval?
> >
> > T.I.A.
> >
> > Johan Borchers
>

Re: A few extval questions

Posted by Rudy De Busscher <rd...@gmail.com>.
Hi Johan,

Q1
Yes, you can combine the JSF validation with ExtVal, like you already found
out since you got 3 messages, 2 of extval and one of JSF.
Although, the idea is that you do everything with ExtVal.  You can use
@Length as a replacement for the f:validateLength tag.

Except for the required attribute of the components. This required attribute
is overwritten by the ExtVal code based on the annotations it find on the
property. (so when no annotations set, attribute shouldn't be altered)

You can deactivate that behaviour by specifying the web context parameter
    <context-param>

<param-name>org.apache.myfaces.extensions.validator.DEACTIVATE_COMPONENT_INITIALIZATION</param-name>
        <param-value>true</param-value>
    </context-param>

You also loose then some functionality related to the validation of empty
fields (like specified in the JSF 2.0 spec for example
javax.faces.VALIDATE_EMPTY_FIELDS)

The parameter can be of help about the problem of the value that disappears.
I can't see any reason why the f:validateLength tag impacts the display of
the field value.  By using the web context parameter, we make sure the
annotation based bypass validation add-on can't interfere with the encoding
of the page (and thus preventing the display of the field)

I tried to recreate you problem with that but had no luck.

Q2
This could be a classloading problem of Tomcat.
Which of the parameters in web.xml did you try,
JPA_VALIDATION_ERROR_MESSAGES or CUSTOM_MESSAGE_BUNDLE

But you also say that, when ExtVal Libraries placed in WEB-INF/lib you don't
need to specify any parameter and all messages are displayed correctly.  So
which messages have you placed in the properties file that are related to
ExtVal.

Regards
Rudy.

On 16 April 2010 08:52, Johan Borchers <jo...@solcon.nl> wrote:

> Hello,
>
> I'm using Tomcat 6.0.20, Mojarra 1.2_14, RichFaces 3.3.3 and Extval 1.2.3
> on Mac en Windows with Java 1.6.0_17
> The Extval libs are:
> extval-annotation-based-bypass-validation-1.2.3.jar
> myfaces-extval-core-1.2.3.jar
> myfaces-extval-generic-support-1.2.3.jar
> myfaces-extval-property-validation-1.2.3.jar
>
> Extval is helping me al lot with bypass-validation because of fields in a
> form that perform looking up values.
> E.g. a manufacturer code field is required in the big picture. But the
> field is also performing an AJAX lookup of the manufacturer as you leave the
> field. At that moment it is legal to leave the field blank because you are
> just tabbing through your fields. So marking the lookup method with
> @BypassValidation(all = true) works perfect.
>
> Question 1 :
> Is it possible to use also the normal validation mechanism of JSF in
> combination with Extval?
>
> E.g I have 3 fields on a form with 2 fields having Extval @required
> validation and one field has the traditional validation property
> required="true" in the XHTML page.
> Sending the form with 3 blank fields gives me 2 faces messages back. Only
> the messages due to Extval validation.
> So for me it looks like Extval is disabling the JSF validation defined in
> the XHTML page.
>
> A little bit more strange is the behavior of the one field without Extval
> validation if I'm adding a validation to the field like <f:validateLength
> minimum="2" maximum="10"/>
> If I send the form with one character in the field and the 2 other fields
> are left blank I receive 3 faces messages (that's nice).
> And then after retrieving the records from the database showing up in a
> list clicking on the list fills normally all three fields in the form, but
> with the f:validateLength the field is left blank.
> Removing the f:validateLength from the field gives be back the normal
> behavior showing the data from the database.
>
>
> Question 2 :
> Where to place the Extval libraries?
>
> For developing I'm using 1 Tomcat installation per project. I do add all
> the libraries to the lib directory of Tomcat. Placing also the Extval
> libraries to this directory has a little problem.
> If i'm setting my locale to nl_NL and have a Messages_nl_NL.properties in
> my root package Mojarra will find it and Extval not. I do get the missing
> resource exception.
> Even using the special parameter in web.xml giving a hint to Extval finding
> the message bundle does not help.
> But I thought that has something to to with the classloader. I decided to
> place just the Extval libraries in the WEB-INF/lib directory. After that
> Extval is finding my locale specific message bundle perfectly even without
> the hint in web.xml.
> I know it is better to place all third party libs in WEB-INF/lib as of
> class loading but during development redeploying the web app a lot of times
> gives problems with e.g. reloading Mojarra.
>
>
> So that's a lot of text for few questions!
>
> I want to use Extval because of the flexible validation options. I hope
> someone can answer my questions so I will better understand how to use
> Extval?
>
> T.I.A.
>
> Johan Borchers