[TEEDA-211] Content-Typeの設定の制御を変更する([Seasar-user:5567][S2JSF]xhmlについて Created: 2006-12-25 Updated: 2006-12-26 Resolved: 2006-12-26 |
|
Status: | Resolved |
Project: | Teeda |
Component/s: | Teeda Core |
Affects Version/s: | 1.0.2 |
Fix Version/s: | 1.0.3 |
Type: | New Feature | Priority: | Major |
Reporter: | yone | Assignee: | yone |
Resolution: | Fixed | Votes: | 0 |
Labels: | 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); // >> 追加 } // <<追加 とすべきでは、ないでしょうか? |
Comments |
Comment by yone [ 2006-12-26 ] |
対応しました。 ContentTypeUtil.java public static boolean isHtmlContentType(String type) { return type.indexOf(JsfConstants.HTML_CONTENT_TYPE) != -1 || type.equals(JsfConstants.ANY_CONTENT_TYPE); } public static boolean isXmlContentType(String type) { return type.indexOf(JsfConstants.XHTML_CONTENT_TYPE) != -1 || type.indexOf(JsfConstants.APPLICATION_XML_CONTENT_TYPE) != -1 || type.indexOf(JsfConstants.TEXT_XML_CONTENT_TYPE) != -1; } |