I posted a patch to WW-1536 that solves these date/if-modified-since issues.
Minor changes that affect only 1 method.
I believe it even simplified some of these things - and it fixes a bug.
Any chance to think about it (and if it makes sense) before releasing 2.0.2?
At least these headers ...

Dariusz Wojtas


On 12/5/06, Musachy Barroso <[EMAIL PROTECTED]> wrote:
I think there should be two jira tickets, one with the Dojo stuff(I
created one for that already), and another with the servlet/date stuff.

On a side note, I created a custom profile and compiled Dojo(really
easy) and everything worked fine, with caching and all, I will mention
it on the dev list to see what other people think for 2.0.3.

musachy

Dariusz Wojtas wrote:
> Hello again,
>
> The static content is served by the main Struts2 Filter:
>  org.apache.struts2.dispatcher.FilterDispatcher
> method:
>  findStaticResource(String, HttpServletResponse)
>
>
> 1) The response headers in non english-locale
> ---------------------------------------
> The (possible) issue with date headers in response comes from
> the fact that this method does not use
>   response.setDateHeader(name, value);
> but
>   response.setHeader(name, value);
> instead.
> Possibly it is done this way to improve performance of generating headers
> because it creates a SimpleDateFormat with the correct pattern.
> But here are possible problems:
> a) the SimpleDateFormat uses default locale (in my case Polish)
>    and the output does not comply the required standard
>      RFC 1123, chapter 5.2.14  "RFC-822 Date and Time Specification"
>      RFC 822, section 5.  "DATE AND TIME SPECIFICATION"
>
>    If the filter wants to format dates on it's own, it should create
>    formatter with the Locale.ENGLISH (there exists constructor that
> allows it).
>
>    Sample response with locale PL
>     Pn, 04 gru 2006 07:55:53 GMT
>    while it should be:
>     Mon, 04 Dec 2006 07:55:53 GMT
>
>
> b) [POSSIBLE BUG] as the SimpleDateFormat javadoc states (since JDK 1.4),
>    it is not safe if multiple threads are accessing the same formatter.
>    This may really lead to some inconsistencies and I would treat it
> as a bug.
>
>
> 2) If-Modified-Since
> ---------------------------------------
> This header should be evaluated in the same method:
> findStaticResource(String, HttpServletResponse)
> A little extra condition and the issue with resending full content
> all-the-time is fixed.
> I could send a patch if there is some interest in it.
>
> Best regards
>  Dariusz Wojtas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to