Re: [STRUTS] Resource bundle and form validation

2006-07-03 Thread Olivier Godineau

Thanks for your message.
In fact, the solution you propose isn't appropriate to my problem.
Because, in my application, the choice of the resource bundle depends on the
user. The key of the ressource bundle is in the user session, so i can't
specify it in the validation configuration file.

Olivier

-- 
View this message in context: 
http://www.nabble.com/-STRUTS--Resource-bundle-and-form-validation-tf1884718.html#a5156387
Sent from the Struts - User forum at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [STRUTS] Resource bundle and form validation

2006-07-03 Thread Niall Pemberton

Support for different resource bundles in the Commons Validator DTD
was added in Struts 1.2.7 and Commons Validator 1.1.4 (although I
would recommend Struts 1.2.9 if you're upgrading and Validator 1.3.0).

So in you validation.xml you can specify a "bundle" attribute on
either the  or  element:


 
 
 

There is a "bundles" example page (in the "validator" section) in the
struts-examples.war webapp which is shipped with the binary
distribution.

You will need to switch from using the  -  elements to the new 
element to take advantage of this.  For example  is
the same as  and if you don't specify the position attribute
then it will guess a (hopefully) sensible value.

Niall

On 7/3/06, Olivier Godineau <[EMAIL PROTECTED]> wrote:


I use several resource bundle for my application. The particularity is the
resource bundle is depending of the user?group.

Here, an extract from the struts config file :


   
   
   
   
   
   
   

When I submit a form to be validated
There is no problem to post the right message from the right resource
bundle, whether the validation is on the client side (with javascript)or on
the server side.
But these messages to be posted contain some arguments (the names of the
invalidate form fields).
That?s the problem.
The validation on the customer side returns arguments from the right
resource bundle (the same which contains the messages to expose) due to the
following tag in the JSP:



The validation ont the server side returns arguments from the application
resource bundle (the default resource bundle as declared at the struts
config file :


However the JSP declaration is :


Because of the dynamic call of the resource bundle(in the jsp examples, i
hide the dynamic bundle call for more readability ), it isn't possible to
specify the resource bundle on the validation.xml file as  field "arg0"
attribute from the field "field".
Extract of the file validation.xml :


   
   
   
   
   
   
   
   

Does exists a solution at this problem of behavior between server and client
or is it a bug from struts?

Regards
Olivier Godineau



--
View this message in context: 
http://www.nabble.com/-STRUTS--Resource-bundle-and-form-validation-tf1884718.html#a5152197
Sent from the Struts - User forum at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[STRUTS] Resource bundle and form validation

2006-07-03 Thread Olivier Godineau

I use several resource bundle for my application. The particularity is the
resource bundle is depending of the user?group.

Here, an extract from the struts config file :










When I submit a form to be validated
There is no problem to post the right message from the right resource
bundle, whether the validation is on the client side (with javascript)or on
the server side.
But these messages to be posted contain some arguments (the names of the
invalidate form fields). 
That?s the problem. 
The validation on the customer side returns arguments from the right
resource bundle (the same which contains the messages to expose) due to the
following tag in the JSP: 



The validation ont the server side returns arguments from the application
resource bundle (the default resource bundle as declared at the struts
config file :


However the JSP declaration is :


Because of the dynamic call of the resource bundle(in the jsp examples, i
hide the dynamic bundle call for more readability ), it isn't possible to
specify the resource bundle on the validation.xml file as  field "arg0"
attribute from the field "field".
Extract of the file validation.xml :
 










Does exists a solution at this problem of behavior between server and client
or is it a bug from struts?

Regards
Olivier Godineau



-- 
View this message in context: 
http://www.nabble.com/-STRUTS--Resource-bundle-and-form-validation-tf1884718.html#a5152197
Sent from the Struts - User forum at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]