You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Karl Stenerud <ka...@webartjapan.com> on 2003/03/19 09:16:16 UTC

Setting content-type

I'm trying to make sure the content type of documents served by the struts 
framework are set to Shift_JIS.

Is this a setting in struts or should it be set in the servlet container 
(Tomcat)?

Currently, I'm getting the following response from http requests:

HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=BB8C80087656F88DB02227A4572331A3; Path=/tokoname
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 2046
Date: Wed, 19 Mar 2003 08:00:18 GMT
Server: Apache Coyote/1.0
Connection: close


I need to get:

HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=BB8C80087656F88DB02227A4572331A3; Path=/tokoname
Content-Type: text/html;charset=Shift_JIS
Content-Length: 2046
Date: Wed, 19 Mar 2003 08:00:18 GMT
Server: Apache Coyote/1.0
Connection: close


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


Re: Setting content-type

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 19 Mar 2003, Karl Stenerud wrote:

> Date: Wed, 19 Mar 2003 17:16:16 +0900
> From: Karl Stenerud <ka...@webartjapan.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: Struts Users Mailing List <st...@jakarta.apache.org>
> Subject: Setting content-type
>
> I'm trying to make sure the content type of documents served by the struts
> framework are set to Shift_JIS.
>
> Is this a setting in struts or should it be set in the servlet container
> (Tomcat)?
>

Setting the content type (including the character encoding) is the
responsibility of the servlet or JSP page that is generating the content.
If you're using a servlet, call setContentType() yourself.  If you're
using a JSP page, the following page directive at the top will do what you
want:

  <%@ page contentType="text/html;charset=Shift_JIS" %>

Craig


> Currently, I'm getting the following response from http requests:
>
> HTTP/1.1 200 OK
> Set-Cookie: JSESSIONID=BB8C80087656F88DB02227A4572331A3; Path=/tokoname
> Content-Type: text/html;charset=ISO-8859-1
> Content-Length: 2046
> Date: Wed, 19 Mar 2003 08:00:18 GMT
> Server: Apache Coyote/1.0
> Connection: close
>
>
> I need to get:
>
> HTTP/1.1 200 OK
> Set-Cookie: JSESSIONID=BB8C80087656F88DB02227A4572331A3; Path=/tokoname
> Content-Type: text/html;charset=Shift_JIS
> Content-Length: 2046
> Date: Wed, 19 Mar 2003 08:00:18 GMT
> Server: Apache Coyote/1.0
> Connection: close
>
>
> ---------------------------------------------------------------------
> 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