struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Moons Manuel <Manuel.Mo...@sydney-tristar.com>
Subject RE: Action BEFORE a page is constructed?
Date Tue, 10 Jul 2001 07:09:39 GMT
<action path="/prepareorder" type="sandwich.web.order.PrepareOrderAction">
        	<forward  name="success" path="/order.jsp"/>
</action>

If you want to do some preparations before you create the form  you can make
a new actionclass without a form class.

<action path="/prepareorder" type="sandwich.web.order.PrepareOrderAction">
        	<forward  name="success" path="/order.jsp"/>
</action>

Now when you want to call you new screen you first call this action wich is
not linked to a form, when this action succeeds, you can call you jsp page,
wich has a form in it.  To fill this form you make an instance of this forms
form class and fill it using the set methods.  After this you put this form
into the session scope.  Like this
request.getSession().setAttribute("orderForm",orderForm);

Now you form will be filled in when it is shown on the screen.

> -----Original Message-----
> From:	peter [SMTP:p_spiessbach@gmx.de]
> Sent:	dinsdag 10 juli 2001 8:50
> To:	struts-user@jakarta.apache.org
> Subject:	Action BEFORE a page is constructed?
> 
> Action BEFORE a page is constructed?
> 
> As far as I understood the working of struts, you inherit the FORM and
> the ACTION classes. The forms are constructed BEFORE a page is shown -
> if values
> are already available, they will be shown. AFTER the page is submitted,
> the
> ACTION is called with the FORM element filled with the appropriate
> values.
> 
> But what do I do to make any data available to the next page?
> 
> I can do so in the preceeding ACTION. But this means, I have to do so in
> all
> preceding actions of this page. This would be a copy of code.
> So I am simply looking for a way to be called, just BEFORE the page is
> created.
> The only mehtod I know, is the Construction of the FORM. But there I do
> not have any link to the SessionContext which is my main anker element.
> 
> If anyone has an idea what I am talking about, please help.
> 
> Thanks
> Peter
> 
> p_spiessbach@gmx.de
> 
> 

Mime
View raw message