the <jsp:include> action page has access to the JspWriter object only (i.e.
serves content), which gets thrown away /throws exception when you do a
sendRedirect [you are telling the server not to serve any content, instead
go to a different page; technically, sendRedirect causes the server to send
a HTTP 302 message to the client telling it that the resource has moved to
the new URL, and the client/browser connects to it]

You have to use a different mechanism to build the content of your email
message, e.g. a bean.

-----Original Message-----
From: Anders Callertun [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 08, 2002 8:12 AM
To: Orion-Interest
Subject: SV: Taglib + jsp:include + sendRedirect does not work?


> First complete the tag library and then use jsp:include.

But that will not do what I want. I want the parsed, compiled
and included file be sent as a mail, so it must be in the body
of the sendMail-tag.

/Anders Callertun____________________________________________
 Net Entertainment AB   [EMAIL PROTECTED]
 Hammarby Kajväg 14     phone +46-8-55 69 67 12
 120 30  STOCKHOLM      fax   +46-8-55 69 67 07
 icq 384204             cell  +46 70 486 77 39


> -----Ursprungligt meddelande-----
> Från: prasanth sb [mailto:[EMAIL PROTECTED]]
> Skickat: den 5 april 2002 16:46
> Till: Orion-Interest
> Ämne: Re: Taglib + jsp:include + sendRedirect does not work?
> 
> 
> Hi Anders,
>        First complete the tag library and then use jsp:include.
> 
> <util:sendMail
>      from="[EMAIL PROTECTED]"
>      to="[EMAIL PROTECTED]"
>      subject="testmail">
> </util:sendMail>
> <jsp:include page="/templates/smalltext.txt" />
> 
> thanks,
> Prasanth
> 
> 
> 
> 
> 
> >From: Anders Callertun <[EMAIL PROTECTED]>
> >Reply-To: Orion-Interest <[EMAIL PROTECTED]>
> >To: Orion-Interest <[EMAIL PROTECTED]>
> >Subject: Taglib + jsp:include + sendRedirect does not work?
> >Date: Tue, 2 Apr 2002 17:31:34 +0200
> >
> >The following jsp-file generates this Exception:
> >
> >java.lang.IllegalStateException: Response has already been 
> committed, be
> >sure not to write to the OutputStream or to trigger a commit 
> due to any
> >other action before calling this method.
> >
> >------------test.jsp--------------
> ><%@taglib uri="utiltags" prefix="util" %>
> >
> ><util:sendMail
> >     from="[EMAIL PROTECTED]"
> >     to="[EMAIL PROTECTED]"
> >     subject="testmail">
> >   <jsp:include page="/templates/smalltext.txt" />
> ></util:sendMail>
> >
> ><%
> >response.sendRedirect("http://www.google.com/";);
> >%>
> >----------------------------------
> >
> >If I instead of the jsp:include tag, inserts the textfile in the
> >jsp-page, it works. I've tried other taglibs and used a jsp:include
> >for the body, for both Orion 1.5.2 and 1.5.3 and I get the 
> same error.
> >
> >Am I doing something wrong? Is it Orion? Or is this not a 
> valid thing to
> >do?
> >
> >
> >Thanks,
> >
> >Anders
> >
> 
> 
> _________________________________________________________________
> Join the world's largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
> 
> 

Reply via email to