Every JSP page in my application is going to have two actions associated with it. One action will always be called prior to displaying the JSP page. The other will be called to process the user's input. In the struts-config, both of these actions are configured with the same form bean. Thus, when Action 1 is called, it has an instance of the ActionForm and that instance is already in the appropriate scope, etc. All I have to do is populate the values and the JSP page can display them.

struts-config.xml:
    <action path="/newinsurance"
            type="webmedx.web.common.actions.AddInsuranceAction"
            name="InsuranceBean" validate="false" scope="request">
      <forward name="success"
               path="/newinsurance.jsp"
               redirect="false">
      </forward>
    </action>
    <action path="/addInsurance"
            type="webmedx.web.common.actions.SaveInsuranceAction"
            name="InsuranceBean" validate="true" scope="request">
    </action>

In my AddInsuranceAction, I can populate the InsuranceBean with information from the database and the newinsurance.jsp will "just see it".

-- Jeff


Roland Carlsson wrote:
Hi!

I am looking for a better way to pre-populate my (html)forms when building
to allow the users to edit data from a database.

I know that I can create an populate a DynaValidatorBean but I don't know
where to put it so that I can use it from my (html)from.

Thanks in advance
Roland Carlsson

Ps: The mail-arcive doesn't work, so I appologize if I repost something that
already have been answerd.


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



Reply via email to