You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Daniel Rindt <dr...@visetics.com> on 2010/09/08 08:35:54 UTC

form question

Hello,

i created an action what is displaying a form. This form also shows the
input errors. The action implements the Preparable Interface to provide
collections to display. My save method is in the same action class.

Is it possible to have a mapping for just one action name, what is
caring about display the form and save the values and also show
validation error messages?

I experiment since hours to achive that. Here are my mappings:
=== 8< ===
<action name="displayRegform" class="action.Register" method="input">
  <result name="input">/registration/registrationForm.jsp</result>
  <result name="success"
type="redirectAction">registrationSuccessfulThankYou			</result>
</action>
<action name="displayRegform" class="action.Register" method="add">
  <result name="input">/registration/registrationForm.jsp</result>
  <result name="success"
type="redirectAction">registrationSuccessfulThankYou			</result>
</action>
<action name="registrationSuccessfulThankYou">
	<interceptor-ref name="basicStackHibernate" />
<result>/registration/registrationSuccessThankYou.jsp</result>
</action>
=== 8< ===

TIA
Daniel

Re: form question

Posted by Daniel Rindt <dr...@visetics.com>.
Am Mittwoch, den 08.09.2010, 09:29 +0200 schrieb Paweł Wielgus:
> yes You can,
Hi Paweł,

thanks it works. It's more simple as i thought.

Daniel

Re: form question

Posted by Paweł Wielgus <po...@gmail.com>.
Hi Daniel,
yes You can,
link that will enter the page is:
/myaction!input
so input method will be called
and saving data is:
/myaction
that way validation errors will only show up when standard /myaction is called.

Best greetings,
Paweł Wielgus.


2010/9/8 Daniel Rindt <dr...@visetics.com>:
> Hello,
>
> i created an action what is displaying a form. This form also shows the
> input errors. The action implements the Preparable Interface to provide
> collections to display. My save method is in the same action class.
>
> Is it possible to have a mapping for just one action name, what is
> caring about display the form and save the values and also show
> validation error messages?
>
> I experiment since hours to achive that. Here are my mappings:
> === 8< ===
> <action name="displayRegform" class="action.Register" method="input">
>  <result name="input">/registration/registrationForm.jsp</result>
>  <result name="success"
> type="redirectAction">registrationSuccessfulThankYou                    </result>
> </action>
> <action name="displayRegform" class="action.Register" method="add">
>  <result name="input">/registration/registrationForm.jsp</result>
>  <result name="success"
> type="redirectAction">registrationSuccessfulThankYou                    </result>
> </action>
> <action name="registrationSuccessfulThankYou">
>        <interceptor-ref name="basicStackHibernate" />
> <result>/registration/registrationSuccessThankYou.jsp</result>
> </action>
> === 8< ===
>
> TIA
> Daniel
>

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