struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "johannes Schwarz" <>
Subject AW: Validation - can i use multiple properties ?
Date Tue, 04 May 2004 13:54:23 GMT
I know this and i use this language files.


I use a action to set the language:
	String lang = httpServletRequest.getParameter("language");
	Locale newlang = new Locale(lang);
	this.setLocale(httpServletRequest, newlang);

And in all jsp-Pages i can use the properties. 

But why isn't it possible to use different properties between the
validation file?

If i use three different forms (html-formular), than i would like to use

-> three different validationfiles
	it works, i use between struts-config: 
	<set-property property="pathnames"

	X-Validation.xml is defined for formular 1
	Y-Validation.xml is defined for formular 2 and so on

-> three different configfiles
	it works, i use between struts-config:
	[<!ENTITY actions1	SYSTEM "MyActions1.xml"> ] and at the
position i write &actions;

	MyActions1.xml is defined for formular 1 (all actions for this
	MyActions2.xml is ...

-> three different properties-files
	it works between the jsp-pages, but NOT between VALIDATION.

	//The defenition between config
	<message-resources paramter=”XXX”/>
	<message-resources paramter=”YYY” key=”Mypara1”/>
	<message-resources paramter=”ZZZ” key=”Mypara2”/>
	//My jsp-Pages:
	Page1.jsp: ...<bean:message key=”Field1” bundle=”Mypara1”/>:
<html:text property="field1"...
	Page2.jsp: ...<bean:message key=”Field1” bundle=”Mypara2”/>:
<html:textarea property="field1"...

Why defines validation.xml the properties-file automatically?
(in my example, validation use the ressource-parameter XXX for all

But I would like to define this "for each" line between the Validation

Example (Validation.xml):
	<field ...>
		<!-- i would like to define the value from the file YYY
		<arg0 key="Field1.error" bundle="Mypara1"/>
	<field ...>
		<!-- i would like to define the value from the file ZZ
		<arg0 key="Field1.error" bundle="Mypara2"/>

But "bundle" doesnt work ;-(


-----Ursprüngliche Nachricht-----
Von: [] 
Gesendet: Dienstag, 4. Mai 2004 13:24
Betreff: RE: Validation - can i use multiple properties ?

Hi Johannes, 

are you aware of localization / i18n support by having multiple language
property files? Like:

Struts then chooses the properties-file depending on locale. Maybe a
look at that stuff helps.

good luck

-----Ursprüngliche Nachricht-----
Betreff: Validation - can i use multiple properties ?

with struts-config.xml i define:

<message-resources paramter=”XXX”/>
<message-resources paramter=”YYY” key=”Mypara”/>

Than I can write the following code in a jsp-File:

<bean:message key=”Field1”/> (i see the Field1-value from the XXX-File)
<bean:message key=”Field1” bundle=”Mypara”/> (I see the Field1-value
from the YYY-File)

now I am using a form with validation.xml.
Some fields are required and the shown error is:

<arg0 key=”Field1.error”/>

On Submit I see the Field1.error-value from the XXX-File.
I would like to see the error-value from the YYY-File. Is this possible?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message