Web tier: servlets, JSP, Web frameworks: @SuppressWarnings("serial")

  1. @SuppressWarnings("serial") (2 messages)

    Hello, I'm learning JSF and I'm going through a tuturial from JavaWorld. @SuppressWarnings("serial") appears in a few of the classes in their sample application, but I'm not sure what it is. I'm trying to see if I can get their sample application to run on RAD 6, but RAD does not like that line. I've done a google search but found nothing on what it is. Could someone help me understand what @SuppressWarnings("serial") is and/or does? Thanks in advance for the help.
  2. Hi, If your class implements the interface java.io.Serializeable, either directly or indirectly, you should provide a field called serialVersionUID. If you do not provide this field and compile the class, you will get a warning at compile time. If you do not want this warning, simply add the line @SupressWarnings("serial") before your class definition. Make sure, you use Java 5.0 in order to use annotations. HTH, - G√ľnther
  3. Re: @SuppressWarnings("serial")[ Go to top ]

    If your class is failing to use generics, use @SuppressWarnings( "unchecked" ) cheers, http://www.javaicillusion.blogspot.com/