[Seasar-user:18088] 【sastruts】response.setContentTypeを設定しても、HTTPヘッダーに送出されない

aoyogi kouhei [E-MAIL ADDRESS DELETED]
2009年 7月 28日 (火) 16:38:18 JST


お世話になります。青柳と言います。

sastruts 1.0.4-sp5で以下のようなコードを実行しました。

    @Resource
    protected HttpServletResponse response;

    public String meta;
    public String docType;

    @Execute(validator = false)
    public String index()
    {
        Mobile mobile = Mobile.getMobile(RequestUtil.getRequest());
        if (mobile.isDocomo()) {
            meta = "<meta http-equiv=\"Content-Type\"
content=\"application/xhtml+xml; charset=utf-8\" />";
            docType = "<!DOCTYPE html PUBLIC \"-//i-mode group (ja)//DTD
XHTML i-XHTML(Locale/Ver.=ja/1.0) 1.0//EN\" \"i-xhtml_4ja_10.dtd\">";
            response.setContentType("application/xhtml+xml; charset=utf-8");
        } else {
            meta = "<meta http-equiv=\"Content-Type\" content=\"text/html;
charset=utf-8\" />";
            docType = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0
Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
        }
        return "index.jsp"
    }

この時、docomo携帯で見た時だけ特別なContent-Typeを返したいのですが
docomoでもそれ以外でもヘッダーを確認すると
「Content-Type: text/html;charset=UTF-8 」
となってしまいます。

ちなみに、return null;にすると、求めていたヘッダーが返ってきました。
jspを表示してかつ、ヘッダーを送出する方法はありますか?
-------------- next part --------------
HTMLの添付ファイルを保管しました...
URL: <http://ml.seasar.org/archives/seasar-user/attachments/20090728/1c82d057/attachment.html>


Seasar-user メーリングリストの案内