hi

One way to populate a form before it is used (say you
want to load user information for editing) is to
create an action called preloadUserAction.  In the
config file create an action mapping such as 

<action    path="/edituser"
                      
type="actionbeans.PreloadUserAction"
                       name="userForm"
                       scope="session"
                       input="/selfAdmin.jsp">
        <forward   name="success"             
path="/selfAdmin.jsp"/>
    </action>

The userForm is passed into the preload action.  This
populates the form and then forwards onto the page
that will use that form.  

Jan Fredrik

        ___ Jan Fredrik Øveraasen | Senior Systems Developer 
        ___ Cell Network ASA | Pb. 5313, Sørkedalsv. 10A, N-0304 Oslo,
Norway
        ___ Tel: +47 23196600/35 | Fax: +47 23196601 | Mob: +47 93 49 99 88
   ___ http://www.cellnetwork.com/ |
mailto:[EMAIL PROTECTED]

 


-----Original Message-----
From: "Langøren, Knut Harald" [mailto:[EMAIL PROTECTED]]
Sent: 13. juli 2001 10:54
To: 'Struts-User (E-mail)
Subject: ActionErrors


Hi.

I'm not sure that I've done this the right way, but we'll all have to learn
some day.

We're using struts to help us in building a web-klient accessing a db
through EJB on weblogic6.0.
The jsp-pages I'm making has a lot of different information, which are
coming from different enterprise beans. These beans are initiated in the
Action/perform method. And here is the problem:
If I generate an error in the validate method, the flow is directed to the
page in the input attribute in the xml-file. This page is a jsp-page, and if
you start a jsp-page directly, the perform method is not executed. The
perform is only executed if you access the page through the .do. So when the
system tries to show the jsp-page, the information from the different beans
is not available, due to the perform method not beeing executed. 

How should I do this?
Is it possible to initiate the enterprise beans in some other methods than
the perform? 

Thanks
-KHL

Reply via email to