Had a look in the soruce for 2.21 AnnotationActionValidatorManager line 226
replaces any / in the action alias with -. So in the example below I would
have to give the file the succinct name
CreatePortalUserAction-CreatePortalUser-persistCustomer-validation.xml :-)
On Thu, Nov 4, 2010 at 12:00 PM, Edward Seager wrote:
> Hi all,
>
> I've just started using Struts 2.21 and I've wired up an action with
> RESTfulish way of calling different methods:
>
> class="com.msi.struts.action.internal.CreatePortalUserAction" method="{1}">
> name="none">/WEB-INF/jsp/internal/createPortalUserHome.jsp
> name="newUserPage">/WEB-INF/jsp/internal/createUser.jsp
> name="newCustomerPage">/WEB-INF/jsp/internal/createCustomer.jsp
>
>
> so I can process CreatePortalUser/newUserPage or
> CreatePortalUser/newCustomerPage within the same action.
>
> I'm struggling to do separate validation for each method using this
> approach though. I think I need a file called
> CreatePortalUser-"methodname"-validation.xml for each method, where
> "methodname" equals "CreatePortalUser/newUserPage" or "
> CreatePortalUser/newCustomerPage". But obviously, I can't include a /
> (slash) in the xml's file name. Is there a work around for this? I took a
> look at using the Validation annotation on my action class, but it is
> deprecated?
>
> Cheers,
>
> --
> Eddy Seager
>
--
Eddy Seager