0

I'm creating my first Java Spring application at the moment. Part of it needs to request xml data from another url on a scheduled period; which I have managed to implement fine. Though obviously I only want to update data if there is a change to the data I'm requesting.

The URL I'm requesting is another Java app with a RESTEasy end-point which makes use of e-tags. I've searched around, though can't seem to find an example of how I would check the e-tag before parsing the xml result.

Can anyone suggest how I could do this?

TIA

Rich
  • 1
  • 1

1 Answers1

0

You have to call the service passing the e-tag you have cached last time you call the it.

If the content has not change the server will responde with 304 otherwise you will get 200 with the content you request.

take a look at this article: http://www.infoq.com/articles/etags

ejrav
  • 56
  • 1
  • 3
  • Thanks ejrav, created a hashmap to store the e-tags and is now working perfectly! :) – Rich Apr 08 '12 at 22:48