Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EFC5010C56 for ; Fri, 27 Dec 2013 21:01:50 +0000 (UTC) Received: (qmail 93284 invoked by uid 500); 27 Dec 2013 21:01:50 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 93262 invoked by uid 500); 27 Dec 2013 21:01:50 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 93254 invoked by uid 99); 27 Dec 2013 21:01:50 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Dec 2013 21:01:50 +0000 Date: Fri, 27 Dec 2013 21:01:50 +0000 (UTC) From: "Johno Crawford (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Issue Comment Deleted] (WW-4263) DefaultHttpHeaders.compareIfModifiedSince() throws ParseException when the locale of the web browser is different to the server MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Johno Crawford updated WW-4263: ------------------------------- Comment: was deleted (was: How about something like this Yasser? https://issues.apache.org/jira/secure/attachment/12620611/WW-4263-1.patch) > DefaultHttpHeaders.compareIfModifiedSince() throws ParseException when the locale of the web browser is different to the server > ------------------------------------------------------------------------------------------------------------------------------- > > Key: WW-4263 > URL: https://issues.apache.org/jira/browse/WW-4263 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - REST > Affects Versions: 2.3.15.3 > Reporter: Harry Chan > Labels: restful > Fix For: 2.3.17 > > Attachments: WW-4263-final.patch > > > I am using the RESTFul plugin and this exception is thrown when I visit the page enabled *Caching*. > When I trigger an action from my web browser, it pass the *If-Modified-Since* attribute to server side and the locale of it date format is in *en* - *Wed, 18 Dec 2013 16:00:00 GMT*. > Then, in the server side, the *DefaultHttpHeaders* uses the method *compareIfModifiedSince()* to check if it should return the cached data. However, I found that the *DefaultHttpHeaders.compareIfModifiedSince()* would use the *default locale* of the server for parsing the *If-Modified-Since* input which causes ParseException as the locale of the server is NOT same as the web browser I used. > {code} > 17:24:20.915 [qtp5416428-21] DEBUG o.a.struts2.rest.DefaultHttpHeaders.debug() [8139ea3e-f463-42fa-9642-ecc2b44b7a21][] - Got error parsing If-Modified-Since header value [Wed, 18 Dec 2013 16:00:00 GMT] as [EEE, dd MMM yyyy HH:mm:ss zzz]! > java.text.ParseException: Unparseable date: "Wed, 18 Dec 2013 16:00:00 GMT" > at java.text.DateFormat.parse(DateFormat.java:357) ~[na:1.7.0_09] > at org.apache.struts2.rest.DefaultHttpHeaders.compareIfModifiedSince(DefaultHttpHeaders.java:165) [struts2-rest-plugin-2.3.15.3.jar:2.3.15.3] > at org.apache.struts2.rest.DefaultHttpHeaders.apply(DefaultHttpHeaders.java:149) [struts2-rest-plugin-2.3.15.3.jar:2.3.15.3] > at org.apache.struts2.rest.RestActionInvocation.processResult(RestActionInvocation.java:190) [struts2-rest-plugin-2.3.15.3.jar:2.3.15.3] > at org.apache.struts2.rest.RestActionInvocation.invoke(RestActionInvocation.java:145) [struts2-rest-plugin-2.3.15.3.jar:2.3.15.3] > at com.opensymphony.xwork2.DefaultActionProxy.execute(DefaultActionProxy.java:147) [xwork-core-2.3.15.3.jar:2.3.15.3] > at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:563) [struts2-core-2.3.15.3.jar:2.3.15.3] > ... > {code} -- This message was sent by Atlassian JIRA (v6.1.5#6160)