struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ranko Bijelonic" <rbijelo...@yahoo.com>
Subject RE: ServletException Response has already been committed'
Date Sun, 27 Jul 2003 21:35:38 GMT
Actually, I think I'm completely off on that <include> element.  For some
reason I tought a <forward> element would specify a forwarding ActionForward
and <include> element would specify an included ActionForward.  But I think
the <include> element does not exist.

You can always make this a servlet instead of the action and then
jsp:include that.

-----Original Message-----
From: Sashi Ravipati [mailto:RavipatiS@michigan.gov]
Sent: Friday, July 25, 2003 8:49 AM
To: struts-user@jakarta.apache.org
Subject: RE: ServletException Response has already been committed'



This is for the first JSP
  <action path="/updateprovider"
type="gov.mi.mdch.pe.strutsactions.UpdateProviderAction" >
      <forward name="success"
path="/WEB-INF/jsp/UpdProvDetailInfo.jsp"/>
    </action>

I want to include another JSP  in the above jsp using <jsp:include
page="selectedproviderinfo.do" flush="true">

  <action path="/selectedproviderinfo"
type="gov.mi.mdch.pe.strutsactions.SeletedProviderInfoAction">
      <include path="/WEB-INF/jsp/SelectedProviderInfo.jsp"/>
    </action>


This throws Error Message: Error in servlet

What am I doing wrong here ???


>>> rbijelonic@yahoo.com 07/24/03 04:57PM >>>
Ok I was looking for a way to tell the ActionServlet to include, rahter
than
forward to the view.
It seems you do it with <include> element instead of <forward> element
in
your action mapping configuration.
So your <action path="selectedproviderinfo.do"...> should have a
<include>
instead of a <forward> to that view.
Hope this does it.

ranko

-----Original Message-----
From: Sashi Ravipati [mailto:RavipatiS@michigan.gov]
Sent: Thursday, July 24, 2003 4:47 PM
To: struts-user@jakarta.apache.org
Subject: RE: ServletException Response has already been committed'


The <jsp:include> is not a direct JSP and it needs to retrieve data from
the database and set the values in the Formbean .

I am not sure how this can be achieved, Tiles talks abt it ,but is not
clear to me.



>>> rbijelonic@yahoo.com 07/24/03 04:34PM >>>
When the ActionServlet forwards to your view that is usually the only
forward that happens and everything is fine.
When you include another Struts Action in your view with <jsp:include>,
another forward happens.

If you are not doing anything in the Action but returning an
ActionForward
to the jsp page, maybe you can just go directly to the page in your
<jsp:include> tag.  I don't know how kosher that is in the Struts
environment though.

Is there a way to tell ActionServlet to use include() instead of
forward()?

ranko

-----Original Message-----
From: Sashi Ravipati [mailto:RavipatiS@michigan.gov]
Sent: Thursday, July 24, 2003 3:42 PM
To: struts-user@jakarta.apache.org
Subject: RE: ServletException Response has already been committed'


Going thru the struts archives it is clear that once forward() is done
then the exception is raised. But can some one help as how this can be
achieved using Struts.

I am new to struts so this may be a naive questions, but how can I show
a JSP page without using forward ?

This is what I ma trying to do

<action path=/updateprovider ...>
  <forward name="success" path="/WEB-INF/jsp/UpdProvDetailInfo.jsp"/>
</action>

The UpdProvDetailInfo.jsp has the includes, so without forward how can I
even show the page.

Or Am i missing something..

Thanks

>>> rbijelonic@yahoo.com 07/24/03 03:29PM >>>
I'm not sure how ActionServlet processes ActionForwards, but if it uses
the
forward() method of the RequestDispatcher then the response cannot be
commited already.  In addition, forward() will commit so you cannot try
to
commit again.  This means that if you have more than one <jsp:include>
mapped to a Struts Action, then you will try to commit the respnose
twice.
Or after the the Action is done, the rest of the jsp page will try to
write
more stuff to the client and cause the exception.  If the ActionServlet
is
not using RequestDispatcher.forward() then I don't know.  More
experienced
Struts guys will probably be able to clear this up.

ranko

-----Original Message-----
From: Sashi Ravipati [mailto:RavipatiS@michigan.gov]
Sent: Thursday, July 24, 2003 2:57 PM
To: struts-user@jakarta.apache.org
Subject: Re: ServletException Response has already been committed'


I checked it , it works fine when I just use the
"selectedproviderinfo.do" .
I get this error when I try to Include this another jsp page.

Thanks


>>> adam_l_levine@hotmail.com 07/24/03 02:47PM >>>
is there a chance that accessing "selectedproviderinfo.do"  by itself
would
also cause the same servletexception ?


From: "Sashi Ravipati" <RavipatiS@michigan.gov>
Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
To: <struts-user@jakarta.apache.org>
Subject: ServletException Response has already been committed'
Date: Thu, 24 Jul 2003 14:39:34 -0400

I have a jsp page which I need to include in all my other JSP pages. I
created an action for JSP to be included and used
<jsp:include page="selectedproviderinfo.do" />.
This throws Servlet Exception.

I also tried <tiles:insert page=page="selectedproviderinfo.do"  /> but
the
same result.

How can this be achieved.

Thanks

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message