You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Rice Yeh <ri...@gmail.com> on 2012/01/13 08:19:51 UTC

304 return code for IE9 client on jaxrs resource

Hi,
  I have an application based on cxf jaxrs 2.5.1. The http status code is
200 when accessing some resources on the second time in a session with
firefox . But the http status code is 304 for the same scenario when
accessing thru. IE9. Check both browser's headers, they are similar as
shown below. I like to know how to control the cache mechanism in cxf jaxrs?

IE9 header:
Request    GET /demo/workflow/worklist?citizen=staff/147 HTTP/1.1
Content-Type    application/json
Accept    application/json,application/javascript
X-Requested-With    XMLHttpRequest
Referer    http://192.168.0.101:8080/demo/hr/personal/workspace
Accept-Language    zh-tw
Accept-Encoding    gzip, deflate
User-Agent    Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64;
Trident/5.0; NP06)
Host    192.168.0.101:8080
Connection    Keep-Alive
Cookie    JSESSIONID=13ovr575428dw137rkv3g3ydsx; ACTOR=147

FF
ccept    application/json,application/javascript
Accept-Charset    UTF-8,*
Accept-Encoding    gzip, deflate
Accept-Language    zh-tw,en-us;q=0.7,en;q=0.3
Connection    keep-alive
Content-Type    application/json
Cookie    JSESSIONID=1qhbr2it5yhfn132brhgdjpk64; ACTOR=147
Host    192.168.0.101:8080
Referer    http://192.168.0.101:8080/demo/hr/personal/workspace
User-Agent    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101
Firefox/9.0.1
X-Requested-With    XMLHttpRequest

Re: 304 return code for IE9 client on jaxrs resource

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

On 13/01/12 07:19, Rice Yeh wrote:
> Hi,
>    I have an application based on cxf jaxrs 2.5.1. The http status code is
> 200 when accessing some resources on the second time in a session with
> firefox . But the http status code is 304 for the same scenario when
> accessing thru. IE9. Check both browser's headers, they are similar as
> shown below. I like to know how to control the cache mechanism in cxf jaxrs?

Try using a CacheControl utility class and set a header on Response,

Cheers, Sergey



>
> IE9 header:
> Request    GET /demo/workflow/worklist?citizen=staff/147 HTTP/1.1
> Content-Type    application/json
> Accept    application/json,application/javascript
> X-Requested-With    XMLHttpRequest
> Referer    http://192.168.0.101:8080/demo/hr/personal/workspace
> Accept-Language    zh-tw
> Accept-Encoding    gzip, deflate
> User-Agent    Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64;
> Trident/5.0; NP06)
> Host    192.168.0.101:8080
> Connection    Keep-Alive
> Cookie    JSESSIONID=13ovr575428dw137rkv3g3ydsx; ACTOR=147
>
> FF
> ccept    application/json,application/javascript
> Accept-Charset    UTF-8,*
> Accept-Encoding    gzip, deflate
> Accept-Language    zh-tw,en-us;q=0.7,en;q=0.3
> Connection    keep-alive
> Content-Type    application/json
> Cookie    JSESSIONID=1qhbr2it5yhfn132brhgdjpk64; ACTOR=147
> Host    192.168.0.101:8080
> Referer    http://192.168.0.101:8080/demo/hr/personal/workspace
> User-Agent    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101
> Firefox/9.0.1
> X-Requested-With    XMLHttpRequest
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com