AW: getting error-texts into global xml

"Bernhard Woehrlin" <[email protected]>
Newsgroups gmane.comp.java.strutscx.user
Organization IT.CappuccinoNet.com
Message-ID <000b01c3f6c8$fff34150$4b01a8c0@javaws>
Hi Stephan,

If you want to bypass the Resource Properties (variables_xx.xml) you
could do the following:

// if an error occurs add an error
errors.add("dateElement", new ActionError("someString")); 
request.addAttribute("error_on_date", " Please enter valid date!");

In your stylesheet you can use a simple <xsl:choose> statement to
present the right message:

<xsl:if test="/root/errors/dateElement = node()">
    <xsl:value-of select="//request/error_on_date"/>
</xsl:if>  

Hope this helps...

Regards,

Berny



-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von
Stephan Reichelt
Gesendet: Donnerstag, 19. Februar 2004 08:30
An: [email protected]
Betreff: [Strutscx-user] getting error-texts into global xml

HI,

for detailed error handling (though multi language facilities are not 
necessary), I need also texts in error-entries in strutscx-xml:

As example, something like

errors.add("dateElement", new ActionError("Please enter valid date!"));

should give the entry

<root>
   ...
   <errors>
     <dateElement>Please enter valid date!</dateElement>
     ...
   </errors>
   ...
</root>


Is there any way to do this? For some input Elements we can have up to 5

different messages. It would be very difficult to put all of them into 
variables_XX.xml and filter them via XSL..


MfG,
   Stephan R.
-- 
[email protected]
Fraunhofer IVI          Tel: +49 351 4640 616



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Strutscx-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strutscx-user



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.