struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Setting content-type
Date Wed, 19 Mar 2003 16:39:42 GMT


On Wed, 19 Mar 2003, Karl Stenerud wrote:

> Date: Wed, 19 Mar 2003 17:16:16 +0900
> From: Karl Stenerud <karl@webartjapan.com>
> Reply-To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> To: Struts Users Mailing List <struts-user@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


Mime
View raw message