Is there an equivalent to java @SuppressWarnings i

2019-01-27 19:18发布

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

标签: jsp warnings
3条回答
兄弟一词,经得起流年.
2楼-- · 2019-01-27 19:42

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!

查看更多
可以哭但决不认输i
3楼-- · 2019-01-27 19:52

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.

查看更多
Lonely孤独者°
4楼-- · 2019-01-27 19:57

Yes, just use:

<%! @SuppressWarnings("unchecked") %>
查看更多
登录 后发表回答