>
>
> when Action extends Action Support i get a warning  action does not declare
> serialversionuid.
> Please excuse my ignorance if this was basic questions...
>
> 1) what is advantage of declaring serialversionuid in action class?
>
> 2) when does the action class gets serialized.Even in Clustered Environment
> i don't see action needs serialization.
> Please tell any scenario where action needs to be serialized.?
>
> 3) If my action does not get serialized why do i need to add unnecessary
> code(declare serialversionuid) to my action making it Big.?
>
> 4) I assume serialversionuid makes sense only when the action gets
> serialized.is this right?
>
> I will be really grateful if someone shares your ideas.
>

I can answer the obvious part of this; You get the warning because your
action is extending ActionSupport and ActionSupport implements
Serializable.  If needed you can read about serialVersionUID here [1] or
just google serialVersionUID as there are lots of sites that explain it.  So
since your class is Serializable you should add serialVersionUID to comply
with the 'interface' and stop the warnings.  As for point 3) it's hard see
how adding a single "static final long" can be blamed for making your action
'Big'.

The more interesting question is; Why does ActionSupport implement
Serializable?  I believe your argument in 2) make sense, the action objects
should never be serialized, or I'm I also missing something?


[1] http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html

Reply via email to