struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: struts 2 validation if use with spring
Date Mon, 11 Mar 2013 22:51:30 GMT
2013/3/9 john lee <sh_thorn_bird@yahoo.com>:
> i just checked your demo, looks like the first tricky is to define proxy action name
signin in struts.xml

It isn't any trick, it's the normal why how to define many actions
base on one action class.

> struts.xml
>
> <action name="signin" method="signin" class="loginAction">
>       <result name="input">/example/Login.jsp</result>
>       <result type="redirectAction">Welcome</result>
>     </action>
>
> ************************************************
>
> and second tricky to define signin method in the file LoginAction.java
>
>
> LoinAction.java
> ...
>
> public String signin() {
>         return SUCCESS;
>     }
> ...
>
> ************************************************
>
> my question next is:
>
> why can not use  Login-validation.xml directly ? but have to use your "proxy method"
to work around?

You can but then the validation will be fired also when you just enter
the login page which isn't what user expect - to be more specific,
validation will be fired for each action defined base on Login class.

> is this the only way to lett struts2/spring validation works?

As I said no, but thus presents the clear way what is validated when.


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message