multiple validation result page in one action / validation against a session attribute?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

multiple validation result page in one action / validation against a session attribute?

JoshN
Hi guys,

I have a couple of queries here...

1)

I have a sample action below, and I need to do validations at both login.jsp and form.jsp.
However, I can only declare 1 "input" page in this case... Is there anyway to set the "input" such that it points to login.jsp when it is login, and form.jsp when it is form?

I saw that we can use {1}.jsp, similar to calling the method, but this is not feasible in case the name of the jsp page is changed, and we will need to edit the java method name...

<action name="newApplicant_*" method="{1}" class="newAppl">
        <result name="login">/applicant/login.jsp</result>
        <result name="form">/applicant/form.jsp</result>
  <result name="input">/applicant/login.jsp</result>
        <result name="success">/applicant/confirmation.jsp</result>
</action>

2)

How does ActionContext differ from SessionAware? In my validation class, I have no choice but to use ActionContext... Is this a good practice?



Thanks for the help in advance!