Hi Craig,

Thanks for your quick response...
I understand that RequestDispatcher.forward() erases any headers but I'm not
setting any header info in the servlet. I want to set it in the jsp, how do
I do that!!
I've the charset info in the databean and I want to use that bean to set it
in the jsp like I indicated in my previous mail:

<%@ page language="java" %>
<jsp:useBean id="controller" scope="request"
class="apps.test.LoginController" ></jsp:useBean>
<% response.setContentType("text/html;charset=" + controller.getCharset());>
%>

Any idea??

Hope I was clear!!

Thanks,
-Ratnakar


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Craig
R. McClanahan
Sent: Friday, September 07, 2001 9:45 AM
To: [EMAIL PROTECTED]
Subject: Re: Servlet/JSP - content-type


Calling RequestDispatcher.forward() erases any headers that have been set
by the servlet, so your technique is not going to work.  You will have to
set the content type in the JSP page.

Craig


On Fri, 7 Sep 2001, Ratnakar  Palle wrote:

> Date: Fri, 7 Sep 2001 09:35:36 -0700
> From: Ratnakar  Palle <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Servlet/JSP - content-type
>
> Hi All,
>
> I'm using model 2 architecture, i.e. request comes to servlet, servlet
does
> the process and creates the bean and forwards it to JSP. Finally, jsp
sends
> the response to the client.
> But, I've a question about the content-type. My bean, should set the
> content-type on jsp and I don't want jsp to set the default content-type.
>
> I'm doing something like this:
> <%@ page language="java" %>
> <jsp:useBean id="controller" scope="request"
> class="apps.test.LoginController" ></jsp:useBean>
> <% response.setContentType("text/html;charset=" +
controller.getCharset());
> %>
>
> But, looks like jsp is ignoring the content-type set by me because jsp by
> itself sets the default content-type as I didn't provide any contentType
> parameter with "<%@ page " tag.
>
> Do you've any idea, how to overcome this situation??
>
> Thanks,
> -Ratnakar
>
>

Reply via email to