tags:

views:

466

answers:

3

The question is in the title : "Is there an equivalent to java @SuppressWarnings in JSP ?"

A: 

I don't believe so, in fact i believe annotations cannot be used within a JSP file. You'll have you use the try / catch and handle your exception.

emeraldjava
+2  A: 

If you are getting warnings in the code generated from a JSP (or in in-line code in a JSP), one solution is to move the problem code into a Servlet or into a utility class. That way you can mark it up to your heart's content, and your JSP has less Java code in it. Win-win!

Eddie
That's what I intended to do in the first place, but I asked the question by curiosity...
Vinze
A: 

Yes, just use:

<%! @SuppressWarnings("unchecked") %>
Brett

related questions