Thorsten,

As you didn't provide all the relevant code its very difficult for me to help 
you out here.
Could you post the important parts of your UserRegistrationIndexAction.java, UserRegistration.jsp, UserRegistrationSubmitAction.java and RegistrationForm.java?
Also, a stack trace from the reset method (Thread.dumpStack()) might be very 
helpful.

Regards,

Ate

Thorsten Berger wrote:
Hi all.

I'm using the current version of the struts bridge and have a problem with error validation in my user registration actions.
My action mappings are:

-------8<-------------------------------------------------------------------------------------------------------
 <global-forwards>
   <forward   name="registration"         path="/UserRegistration.do"/>
 </global-forwards>

 <action-mappings>

     <!-- welcome page as workaround for PB-1, see
            http://issues.apache.org/jira/browse/PB-1 -->
     <action    path="/UserRegistrationStart"
include="/WEB-INF/view/userregistration/UserRegistrationStart.jsp"/>

     <action
         path="/UserRegistration"
type="de.thorstenberger.elatePortal.portlets.userregistration.UserRegistrationIndexAction"> <forward name="success" path="/WEB-INF/view/userregistration/UserRegistration.jsp"/> <forward name="inactive" path="/UserRegistrationInactive.do" redirect="true"/>
     </action>
       <action    path="/SubmitUserRegistration"
type="de.thorstenberger.elatePortal.portlets.userregistration.UserRegistrationSubmitAction"
                name="RegistrationForm"
                input="registration"
                scope="request">
<forward name="success" path="/PendingAccountAdded.do" redirect="true"/> <forward name="inactive" path="/UserRegistrationInactive.do" redirect="true"/>
     </action>

<action path="/UserRegistrationInactive" include="/WEB-INF/view/userregistration/UserRegistrationInactive.jsp"/> <action path="/PendingAccountAdded" include="/WEB-INF/view/userregistration/PendingAccountAdded.jsp"/>

 </action-mappings>
-------8<-------------------------------------------------------------------------------------------------------

When there are validation errors in the RegistrationForm, the bridge forwards (back) to the input path (/UserRegistration) and the RenderContext is saved correctly, so error messages appear. The problem now is, that the reset() method of the RegistrationForm is called when the /UserRegistration action forwards again to the jsp, resulting in a form with empty textfields and error messages.

I did remote debugging and the app flow is as follows:
- enter /UserRegistration.do by a link on /UserRegistrationStart (see issue PB-1)
   -> resets RegistrationForm
- post the form values to /SubmitUserRegistration.do
   -> reset RegistrationForm and populate with the posted values
   -> the following validate() then returns errors
   -> this forwards back to /UserRegistration.do
      -> resets ActionForm again (that should not be the case)

I tried everything to prevent it from resetting the form, but I couldn't figure out what's going wrong yet, although I spent a quite huge amount of time already ;)
Btw., the actions do work correctly when called standalone.

I would really appreciate some hints pointing me in the right direction. Hope I've just overseen something....

Regards,
T. Berger

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to