You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Unmesh joshi <un...@hotmail.com> on 2009/11/26 16:44:15 UTC

Use of hashcode as ETag in Rest plugin.

Hi,
Rest plugin's DefaultHttpHeaders class uses hashCode of the model object (if the action is model driven) or hascode of the action object.I guess its a wrong assumption to make that two different objects will have different hashcodes. So we can have same hashcode even if model objects are not equal and that will wrongly send 304 response even if resource is changed. Is this a known bug in REST plugin?I have also posted this on struts dev mailing list.
Thanks,Unmesh  		 	   		  
_________________________________________________________________
Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop

Re: Use of hashcode as ETag in Rest plugin.

Posted by Don Brown <mr...@twdata.org>.
The default etag value of the object's hashcode is really only meant
as a helpful default to get you going.  I'd highly recommend setting
your own etag value with something like the underlying db row's
timestamp or whatever.

Don

On Fri, Nov 27, 2009 at 2:44 AM, Unmesh joshi <un...@hotmail.com> wrote:
>
> Hi,
> Rest plugin's DefaultHttpHeaders class uses hashCode of the model object (if the action is model driven) or hascode of the action object.I guess its a wrong assumption to make that two different objects will have different hashcodes. So we can have same hashcode even if model objects are not equal and that will wrongly send 304 response even if resource is changed. Is this a known bug in REST plugin?I have also posted this on struts dev mailing list.
> Thanks,Unmesh
> _________________________________________________________________
> Windows 7: Find the right PC for you. Learn more.
> http://windows.microsoft.com/shop

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org