Re: alternative to strutscx using xsl and achieving localization?
Yayo <[email protected]> Tue, 29 Mar 2005 09:18:02 +0000 (UTC)
| Newsgroups | gmane.comp.java.strutscx.user |
|---|---|
| Message-ID | <[email protected]> |
Hi again. I've modified StrutsCX to get the same functionallity as Struts with
Validator. My messages are output as they where in good'ol Struts. Just need to
do somethinglikethis:
<!-- In the validation... -->
<arg0 key="login.label" resource="false"/>
<!--
This way the message goes "as is" to the output XML so I can select with
XPath the correct resource string...
-->
// in an action
errors.add("login", new ActioError("errors.required", "login.label"));
//same as up there
I've done my own DocumentBuilder based on StrutsCX one so I output the errors as
thiz:
<root>
<!-- ... -->
<errors>
<error key="errors.required">
<arg0>login.label</arg0>
</error>
</errors>
and I've got a template wich call is similar to this:
<xsl:call-template name="errors">
<xsl:with-param name="property" value="login"/>
</xsl:call-template>
... and the new resources will look like thiz
<messages>
<msg key="errors.required">
{0} is required.
</msg>
</messages>
Ok, So forth...
I'd like to someone to show me up an efficient way to concatenate the arg0...
argn elements in an efficient way 'cos right now what I'm doing is substring and
reassign to a new variable each time... Could it be possible to substitute a
string from an string?
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click