jsr344-experts@javaserverfaces-spec-public.java.net

[jsr344-experts] Re: Re: [1130-UserAgentNeedsUpdate] DISCUSSION

From: Neil Griffin <neil.griffin_at_portletfaces.org>
Date: Wed, 8 Aug 2012 10:19:47 -0400

Hi Ed,

I think we are in agreement. In the servlet/webapp case, the map returned by ExternalContext.html#getRequestHeaderMap() [3] would need to call HttpServletRequest#getHeader("If-Modified-Since") [4] in order to get the request header value.

Unfortunately there is no method named getHeader(String) on a PortletRequest. So in the portlet case, the best we can do is call PortletRequest#getProperty(String) [2] and hope that the portlet container actually provides it.

Neil

[3] http://javaserverfaces.java.net/nonav/docs/2.0/javadocs/javax/faces/context/ExternalContext.html#getRequestHeaderMap()
[4] http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getHeader(String)

On Aug 7, 2012, at 6:32 PM, Edward Burns wrote:

>>>>>> On Tue, 7 Aug 2012 15:19:08 -0400, Neil Griffin <neil.griffin_at_portletfaces.org> said:
>
> NG> Portlet containers may return header names with
> NG> PortletRequest#getPropertyNames() [1] and values with
> NG> PortletRequest#getProperty(String) [2] but are not required to do
> NG> so. Case in point: Liferay Portal does not return the
> NG> "If-Modified-Since" header. So I think this can only be officially
> NG> tightened up in the servlet case.
>
> But JSF doesn't return the If-Modified-Since header either. It's a
> request-header. Please help me understand your comment in light of this
> fact.
>
> [1] 14.25 If-Modified-Since
>
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
>
> The If-Modified-Since request-header field is used with a method to
> make it conditional: if the requested variant has not been modified
> since the time specified in this field, an entity will not be returned
> from the server; instead, a 304 (not modified) response will be
> returned without any message-body.
>
> Ed
>
> --
> | edward.burns_at_oracle.com | office: +1 407 458 0017
> | homepage: | http://ridingthecrest.com/