Hi Devon,
Thanks for your reply.  I think that my understanding of the framework is
sparse as I dont understand how this works.  I have an app which collects
insurance quote information.  We are using an EJB to store the information
as it is collected from the user on multiple screens.  My starting point is
/editQuoteSummary which looks up the EJB and populates the quotesummaryForm
with default user data using the class
com.libertymutual.lit.pca.EditQuoteSummaryAction.  In my original version I
then had the 'success' forwarding to a PCATable.jsp file (rather than
PCAFrame.jsp as is shown below) which had 2 jsp includes(PCANavigation.jsp
and PCAQuoteSummary.jsp), the latter of which had the definition for the
form <html:form action="/saveQuoteSummary.do">.  This seemed to work OK. 


    <!-- Edit quote summary -->
        <action    path="/editQuoteSummary"
                   type="com.libertymutual.lit.pca.EditQuoteSummaryAction"
                   name="quotesummaryForm"
                   scope="request"
                validate="false">
           <forward name="failure"              path="/mainMenu.jsp"/>
           <forward name="success"              path="/PCAFrame.jsp"/>
    </action>

     <!-- Save quote summary -->
        <action    path="/saveQuoteSummary"
                   type="com.libertymutual.lit.pca.SaveQuoteSummaryAction"
                   name="quotesummaryForm"
                   scope="request"
                validate="false">
           <forward name="failure"              path="/PCAQuoteSum.jsp"/>
           <forward name="success"
path="/editPropertyQuestions.do"/>
    </action>

Our user then wished to implement frames.  So I changed the PCATable.jsp to
a frames implementation (PCAFrame.jsp).  However when I access the
PCAFrame.jsp I get the following error in the frame asscociated with
PCAQuoteSummary.jsp:
Error 500
An error has occured while processing
request:http://localhost/PCAWebAppEJB2/PCAQuoteSummary.jsp
Message: Server caught unhandled exception from servlet [jsp]: Cannot find
bean quotesummaryForm in scope request

Can you see what I am doing wrong ?

Thanks
Glynn



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 18 July 2001 13:50
To: [EMAIL PROTECTED]
Subject: RE: Using Frames within STRUTS


> I would like to make use of frames within my STRUTS application but am
> unsure how the framework handles frames.  For example, if I 
> have a form
> within a JSP page (form.jsp) and that page is presented to 
> the user within a
> frame (frame.jsp), how should I associate the ActionForm to 
> the form.jsp
> within the struts-config.xml file.  I want the app to navigate to the
> frame.jsp page but cannot associate the ActionBean to this 
> jsp as it does
> not have a form tag.  Is there a recommended solution ?

Not sure I fully understand but here goes...

When form.jsp starts generating the HTML for the form, it will look for
an ActionForm from which it can get default values. The name it will
use to look for this bean is defined in the struts-config.xml under the
Action to which you will be submitting the form. So the ActionForm name
is associated with the Action that receives it rather than the JSP that
generates it. So the fact that the JSP that generates it is wrapped
inside a frame isn't really an issue.

There are at least two other possible problems, though:

        1) If you want the previous Action to preload the ActionForm with
           some information (from a database, for example) you can do
           this by making your own ActionForm bean, filling it in, and
           then saving it in the session scope under the name which is
           declared in the Action that will receive it. It will then be
           found automatically when form.jsp generates the HTML.

        2) If you choose to automatically validate the ActionForm, you
           need to specify the "input" page so that Struts can
           automatically send you back there in case of an error. I don't
           have experience with this but you should be able to specify
           your frame.jsp file as the input source. When it then
           renders form.jsp within, this inner page will still find the
           ActionForm in the context if it were the highest level page.

Does that help?

Devon

Reply via email to