On Tue, 2006-12-12 at 09:08 +0800, red phoenix wrote:
> I have a question about Struts 2.0 Action,I find Action will extends
> ActionSupport,like follows:
> public class GetUpdatedHangmanAction extends ActionSupport implements
> SessionAware {
>  private static final long serialVersionUID = 5506025785406043027L;
>  .....
> 
> 
> I am puzzled with variable serialVersionUID,I want to know if this variable
> is necessary for Action,if it is necessary,how to calculate the value of
> serialVersionUID,why it is equals 5506025785406043027?
> 
> Anyone can give me some advice?

Red Phoenix,

No, I don't think the serialVersionUID is necessary for Struts, but it
is good practice to give your Serializable classes some value for it.
Check out the Javadocs for the Serializable interface -- it's a standard
Java interface.

Probably that number was generated by calculating a hash value from the
object's fields.  I seem to remember reading something about some IDEs
producing that value for you.  You can maintain it yourself as well.

Chris

-- 
Christopher D. Goldman
[EMAIL PROTECTED]
415.962.4884


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to