Board index » jbuilder » Seems so simple, but oh man....

Seems so simple, but oh man....


2003-11-28 01:26:32 AM
jbuilder7
Hey guys,
I'm trying to deploy an html file in a JSP. I reckoned this was done by
using sendRedirect(). And yup, sometimes it workes, but sometimes however I
get an IllegalStateError, which indicates that the response already has been
sent. Now, there *must* be simpler way to redirect your JSP to some
confirmation page. Anyone? please?
Regards,
Jenny
 
 

Re:Seems so simple, but oh man....

Jennifer Ashley Kuiper wrote:
Quote
Hey guys,

I'm trying to deploy an html file in a JSP. I reckoned this was done by
using sendRedirect(). And yup, sometimes it workes, but sometimes however
I get an IllegalStateError, which indicates that the response already has
been sent. Now, there *must* be simpler way to redirect your JSP to some
confirmation page. Anyone? please?

Regards,
Jenny
Hi Jennifer,
when sending a redirect you have to be sure that not one byte was previously
sent to the response.
This JSP won't work:
<%@ page import="xxx"%>
<%
response.sendRedirect(...)
%>
You have to write:
<%@ page import="xxx"
%><%
response.sendRedirect(...)
%>
The difference is that there is no linefeed in the second example.
Regards,
Andreas
 

Re:Seems so simple, but oh man....

Thanks for the response Andreas, but it still won't work. No matter what I
do. Isn't there a way to sorta undo the post and reset everything in order
to send a new reply?
Thanks,
Jenny
"Andreas Meier" < XXXX@XXXXX.COM >schreef in bericht
Quote
Jennifer Ashley Kuiper wrote:

>Hey guys,
>
>I'm trying to deploy an html file in a JSP. I reckoned this was done by
>using sendRedirect(). And yup, sometimes it workes, but sometimes
however
>I get an IllegalStateError, which indicates that the response already
has
>been sent. Now, there *must* be simpler way to redirect your JSP to some
>confirmation page. Anyone? please?
>
>Regards,
>Jenny
Hi Jennifer,

when sending a redirect you have to be sure that not one byte was
previously
sent to the response.

This JSP won't work:

<%@ page import="xxx"%>
<%
response.sendRedirect(...)
%>

You have to write:

<%@ page import="xxx"
%><%
response.sendRedirect(...)
%>

The difference is that there is no linefeed in the second example.

Regards,
Andreas
 

{smallsort}

Re:Seems so simple, but oh man....

Jennifer Ashley Kuiper wrote:
[snipped]
Please read the newsgroup guidelines: they
unequivocally ask you to refrain from
cross-posting and multi-posting.
You appropriately posted this message to the
servlets-jsp newsgroup. Continue this
discussion there. Also, see my response
there.
Thank you.
--
Paul Furbacher (TeamB)
Save time, search the archives:
www.borland.com/newsgroups/ngsearch.html
Is it in Joi Ellis's Faq-O-Matic?
www.visi.com/~gyles19/fom-serve/cache/1.html
Finally, please send responses to the newsgroup only.
That means, do not send email directly to me.
Thank you.