Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to fix "unchecked" warnings in JSP pages  RSS feed

 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a test JSP that gets warning messages during a compile. Specific errors are
Compiling 1 source file to /home/pfarrell/sandbox/bbook/trunk/fnfapp/build/generated/classes
/home/pfarrell/sandbox/bbook/trunk/fnfapp/build/generated/src/org/apache/jsp/WEB_002dINF/pages/test_jsp.java:16: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.Vector
_jspx_dependants.add("/WEB-INF/jspf/top.jspf");
warnings


This is triggered by code that does an include, specifically:



The compiler converts this line to



Is there a clean way to suppress this warning?

Thanks
Pat
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65828
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally, there are so many warnings issued by containers, that this is just another one that I wouldn't worry about it. It's obviously nothing that's going to cause any problems in the running code.

But, if it matters to you, whatever an answer might be is sure to be container-specific. I'm guessing Tomcat?
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote: is sure to be container-specific. I'm guessing Tomcat?

Actually, no, since NetBeans loves Glassfish this month.

GF v2
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65828
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm, we don't have a forum for Glassfish (and moving it to "Other servers" is probably as good as deleting it), so I'll just leave it here. (Unless you'd rather have me move it to the IDEs forum.)

Basically, you'll need to find out how to tell Glassfish (or Netbeans) to suppress the compiler warnings during its translate/compile cycle for the JSPs.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Basically, you'll need to find out how to tell Glassfish (or Netbeans) to suppress the compiler warnings during its translate/compile cycle for the JSPs.


Well, what I really want is to ignore this one, since I'm not generating the Java from the JSP, but leave on the warnings for dumb things that I do.

Of course, a dream IDE would warn me as I typed the errors.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65828
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are writing modern scriptless JSPs, there's really not much you can do in a JSP that'll generate a warning that you'll care about.

Any problems will result in blatant errors, not warnings.

If you have a budget, you might want to check out IntelliJ IDEA as an alternative to Netbeans. Its JSP inspections aren't bad.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!