You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Randall Dietz <Ra...@mim.com.au> on 2001/07/25 04:31:25 UTC

Empty Page returned after Action executed

I'm new to Struts (V1.0) and I'm stuck on what I think is a simple example.

I have an Action and an ActionForm bean that do pretty much nothing. Action
simply returns a reference to "continue" (mapping.findForward("continue"))
and the ActionForm bean has one attribute, "title".

What's happening is that when I execute the action (using <html:link
page="/shipsum.do">), the JSP associated with the action is not being
displayed.  There are no errors, just an empty HTML page with an empty
<body>.  Here are the <form-bean> and <action> entries I use in my config
file:

    <form-bean name="summaryForm" type="com.mim.pilot2.SummaryForm"/>

    <action path="/shipsum"
            type="com.mim.pilot2.SummaryAction"
            name="summaryForm"
            scope="request"
            input="/shipsum.jsp" />

Note that by using System.out I have verified that my SummaryAction class is
being executed.

And... it also does not work if I specify <forward> as shown below:
    <action path="/shipsum"
            type="com.mim.pilot2.SummaryAction"
            name="summaryForm"
            scope="request"
            input="/shipsum.jsp" >
      <forward name="success" path="/shipsum.jsp"/>
    </action>

But... if I use the entry:
    <action path="/shipsum" forward="/shipsum.jsp" />
shipsum.jsp is displayed correctly.

Under what conditions does Struts return an empty HTML page?  Can someone
spot my error?

Thanks,
=========================
Randall Dietz
IT Consultant
Email: randall.dietz@mim.com.au



**********************************************************************
The information contained in this e-mail is confidential and is
intended only for the use of the addressee(s).
If you receive this e-mail in error, any use, distribution or 
copying of this e-mail is not permitted. You are requested to
forward unwanted e-mail and address any problems to the 
MIM Holdings Limited Support Centre.

e-mail: supportcentre@mim.com.au
phone: Australia 1800500646
            International ++61 7 38338042
**********************************************************************

Re: Empty Page returned after Action executed

Posted by Bill Clinton <bc...@snipermail.com>.
Hello,

I have had this problem when I reference a forward that doesn't exist in 
my config file.

You mention that your action returns a reference to "continue": 
(mapping.findForward("continue"))

But your line in your struts-config is:
<forward name="success" path="/shipsum.jsp"/>

rename your forward to "continue" or return a reference to "success" 
like this: (mapping.findForward("success"))


Bill

Randall Dietz wrote:

> I'm new to Struts (V1.0) and I'm stuck on what I think is a simple example.
> 
> I have an Action and an ActionForm bean that do pretty much nothing. Action
> simply returns a reference to "continue" (mapping.findForward("continue"))
> and the ActionForm bean has one attribute, "title".
> 
> What's happening is that when I execute the action (using <html:link
> page="/shipsum.do">), the JSP associated with the action is not being
> displayed.  There are no errors, just an empty HTML page with an empty
> <body>.  Here are the <form-bean> and <action> entries I use in my config
> file:
> 
>     <form-bean name="summaryForm" type="com.mim.pilot2.SummaryForm"/>
> 
>     <action path="/shipsum"
>             type="com.mim.pilot2.SummaryAction"
>             name="summaryForm"
>             scope="request"
>             input="/shipsum.jsp" />
> 
> Note that by using System.out I have verified that my SummaryAction class is
> being executed.
> 
> And... it also does not work if I specify <forward> as shown below:
>     <action path="/shipsum"
>             type="com.mim.pilot2.SummaryAction"
>             name="summaryForm"
>             scope="request"
>             input="/shipsum.jsp" >
>       <forward name="success" path="/shipsum.jsp"/>
>     </action>
> 
> But... if I use the entry:
>     <action path="/shipsum" forward="/shipsum.jsp" />
> shipsum.jsp is displayed correctly.
> 
> Under what conditions does Struts return an empty HTML page?  Can someone
> spot my error?
> 
> Thanks,
> =========================
> Randall Dietz
> IT Consultant
> Email: randall.dietz@mim.com.au
> 
> 
> 
> **********************************************************************
> The information contained in this e-mail is confidential and is
> intended only for the use of the addressee(s).
> If you receive this e-mail in error, any use, distribution or 
> copying of this e-mail is not permitted. You are requested to
> forward unwanted e-mail and address any problems to the 
> MIM Holdings Limited Support Centre.
> 
> e-mail: supportcentre@mim.com.au
> phone: Australia 1800500646
>             International ++61 7 38338042
> **********************************************************************