Hi guys.
From my tests here's what I found:
1) action names with '/' are not usable for declarative action-alias
validation because of java package name (and most probably filesystem )
incompatibilities
2) action names with wildcards and '!' (ie '*!*') are not usable for
declarative action-alias validation. No idea why.
3) action names with wildcards and '_' (ie '*_*') do work for
declarative action-alias validation.
So, for completeness and future reference (should it go into the wiki?),
here's how I configured struts.xml:
<action name="*_*" method="{2}"
class="mypkg.admin.{1}Action">
<result name="view" type="tiles">{1}View</result>
<result name="edit" type="tiles">{1}Edit</result>
<result name="input" type="tiles">{1}Edit</result>
<result name="success-redirect"
type="redirect-action">{1}_{2}</result>
</action>
and then use it in my jsps:
<s:url action="Category_create" namespace="/admin" id="newURL"/>
..and in order to add declarative validation, the above requires
a file named:
CategoryAction-Category_create-validation.xml
Best regards.
--
Robi
Roberto Nunnari wrote:
Oops.. little typo! Correction below, in context.
Maybe using a different separator in action name, like '!'
instead of '/' could help..
But now this leads me to a more general question:
Can action names containing '*' be mapped at all to Action-alias
validation?
Thank you!
--
Robi
Roberto Nunnari wrote:
Hello.
I'd like to use declarative Action-alias field validation for
several Actions/methods in my S2 webpapp.
S2 let's me do in struts.xml elegant things like:
<package name="admin" extends="tiles-default" namespace="/admin">
...
<action name="*/*" method="{2}" class="mypkg.admin.{1}Action">
.. my results..
</action>
...
</package>
and then use it in my jsps:
<s:url action="Category/create" namespace="/admin" id="newURL"/>
..but in order to add declarative validation, that would require
a file named:
CategoryAction/create-validation.xml
CategoryAction-Category/create-validation.xml
but '/' is not a character allowed in filenames.
How to go with this dilemma? Should I drop the slashes in
action names and use more verbose and less flexible declarations
in struts.xml, or is there a better way?
Thank you!
---------------------------------------------------------------------
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]