2013/3/9 john lee <sh_thorn_b...@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-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to