You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Peter Spießbach <p_...@gmx.de> on 2001/07/10 11:56:41 UTC

RE RE: Action BEFORE a page is constructed?

Hello,
I did not get it.

Rather than directly forwarding to /order I now forward to /prepareorder. Is
this right?
However, it looks that I still have an error, because the forwarding from
one action
to another does not work - and even give any helping error message:

After the jsp in action tag 1 is submitting its control to the action
defined in 
action tag one it should call the action in action tag 2. But nothing
happens.
Can you help me?

1       <action  path="/SperrenIntro" 
                 name="SperrenIntroForm"
                
type="de.bankverlag.www.kivi.control.action.SperrenIntroAction"
                 scope="request"
                 input="/SperrenIntro.jsp"
                 validate="false">
            <forward  name="ok"     
path="/SperrenFirstLevelSupportSuchkriterienPre"/>
        </action>

2       <action  path="/SperrenFirstLevelSupportSuchkriterienPre" 
                
type="de.bankverlag.www.kivi.control.action.SperrenFirstLevelSupportSuchkriterienPreAction">
		 <forward  name="success"      
path="/SperrenFirstLevelSupportSuchkriterien.jsp"/>
        </action>

3        <action  path="/SperrenFirstLevelSupportSuchkriterien" 
                 name="SperrenFirstLevelSupportSuchkriterienForm"
                
type="de.bankverlag.www.kivi.control.action.SperrenFirstLevelSupportSuchkriterienAction"
                 scope="request"
                 input="/SperrenFirstLevelSupportSuchkriterien.jsp"
                 validate="true">
            <forward  name="ok"      
path="/SperrenFirstLevelSupportTrefferliste.jsp"/>
        </action>


----------------------------------------------------------------------------
previous message for history

<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
> 
> 



-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

GMX Tipp:

Machen Sie Ihr Hobby zu Geld bei unserem Partner 1&1!
http://profiseller.de/info/index.php3?ac=OM.PS.PS003K00596T0409a