Uploaded image for project: 'Teeda'
  1. Teeda
  2. TEEDA-211

Content-Typeの設定の制御を変更する([Seasar-user:5567][S2JSF]xhmlについて

    XMLWordPrintable

Details

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • 1.0.3
    • 1.0.2
    • Teeda Core
    • None

    Description

      org.seasar.teeda.core.taglib.core.ViewTagを

      ViewTag
          public int doStartTag() throws JspException {
              final int rc = super.doStartTag();
              final FacesContext context = FacesContext.getCurrentInstance();
              AssertionUtil.assertNotNull("FacesContext", context);
              final String encoding = PageContextUtil
                      .getCharacterEncoding(pageContext);
              pageContext.getResponse().setLocale(context.getViewRoot().getLocale());
              final String acceptContentTypes = WebAppUtil.getAcceptHeader(context);
      // >> 追加
              if( acceptContentTypes != null)
              {
      // <<追加
              final String contentType = ContentTypeUtil
                      .getContentType(acceptContentTypes);
              pageContext.getResponse().setContentType(
                      contentType + "; charset=" + encoding);
      // >> 追加
              }
      // <<追加
      

      とすべきでは、ないでしょうか?
      Acceptが指定されなかった場合は、JSPにお任せし、
      Acceptが指定された場合は、Content-Typeを設定すべきと考えますが、
      どうでしょうか?

      Attachments

        Activity

          People

            yone yone
            yone yone
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: