You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Cagatay Civici <ca...@gmail.com> on 2007/05/21 12:42:25 UTC

Content Type on ResponseWriter

Hi,

I just want to discuss an issue I've faced lately.

When a user makes a request with the request header "accept : text/*" ,
response writer cannot be created because "text/*" is not supported.

selectContentType method of HtmlRendererUtils first checks the request
header map for accept key and gets the "text/*" value, since this is not in
the supported content type list, pages are broken for this reason. Should we
select default text/html type for text/* only requests?

Another question I had is about the page directive,  <%@ page
contentType="text/html; charset=utf-8" ...%>, seems to be ignored because
only

context.getExternalContext().getRequestHeaderMap().get("Accept");

is used when trying to select the content type.

Any ideas? I couldn't find anything about this in the spec so far.

Cagatay

Re: Content Type on ResponseWriter

Posted by Cagatay Civici <ca...@gmail.com>.
> - If Accept is just "text/*", defaulting to text/html is appropriate.


Cool, I'll open a issue and fix it then.

- In JSF 1.1, the page directive comes along too late to
>  use as another source of a content type, but in JSF 1.2, I think
>  we could take advantage of it.


Yes, I think we really should do so.

Cagatay

On 5/21/07, Adam Winer <aw...@gmail.com> wrote:
>
> IMO:
> - If Accept is just "text/*", defaulting to text/html is appropriate.
> - In JSF 1.1, the page directive comes along too late to
>   use as another source of a content type, but in JSF 1.2, I think
>   we could take advantage of it.
>
> -- Adam
>
>
>
> On 5/21/07, Cagatay Civici <ca...@gmail.com> wrote:
> > Hi,
> >
> > I just want to discuss an issue I've faced lately.
> >
> > When a user makes a request with the request header "accept : text/*" ,
> > response writer cannot be created because "text/*" is not supported.
> >
> > selectContentType method of HtmlRendererUtils first checks the request
> > header map for accept key and gets the "text/*" value, since this is not
> in
> > the supported content type list, pages are broken for this reason.
> Should we
> > select default text/html type for text/* only requests?
> >
> > Another question I had is about the page directive,  <%@ page
> > contentType="text/html; charset=utf-8" ...%>, seems to be ignored
> because
> > only
> >
> > context.getExternalContext().getRequestHeaderMap().get("Accept");
> >
> > is used when trying to select the content type.
> >
> > Any ideas? I couldn't find anything about this in the spec so far.
> >
> > Cagatay
> >
>

Re: Content Type on ResponseWriter

Posted by Adam Winer <aw...@gmail.com>.
IMO:
- If Accept is just "text/*", defaulting to text/html is appropriate.
- In JSF 1.1, the page directive comes along too late to
  use as another source of a content type, but in JSF 1.2, I think
  we could take advantage of it.

-- Adam



On 5/21/07, Cagatay Civici <ca...@gmail.com> wrote:
> Hi,
>
> I just want to discuss an issue I've faced lately.
>
> When a user makes a request with the request header "accept : text/*" ,
> response writer cannot be created because "text/*" is not supported.
>
> selectContentType method of HtmlRendererUtils first checks the request
> header map for accept key and gets the "text/*" value, since this is not in
> the supported content type list, pages are broken for this reason. Should we
> select default text/html type for text/* only requests?
>
> Another question I had is about the page directive,  <%@ page
> contentType="text/html; charset=utf-8" ...%>, seems to be ignored because
> only
>
> context.getExternalContext().getRequestHeaderMap().get("Accept");
>
> is used when trying to select the content type.
>
> Any ideas? I couldn't find anything about this in the spec so far.
>
> Cagatay
>