Is there an equivalent to java @SuppressWarnings in JSP

后端 未结 3 756
后悔当初
后悔当初 2020-12-20 15:36

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

相关标签:
3条回答
  • 2020-12-20 16:15

    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!

    0 讨论(0)
  • 2020-12-20 16:31

    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.

    0 讨论(0)
  • 2020-12-20 16:34

    Yes, just use:

    <%! @SuppressWarnings("unchecked") %>
    
    0 讨论(0)
提交回复
热议问题