Suppressing Java unchecked warnings in JSP files

后端 未结 3 883
情书的邮戳
情书的邮戳 2021-01-17 14:13

I have a legacy webapp which uses jstl and Struts 1 tags. When I pre-compile the JSP files with Java 5/6, the jstl and Struts 1 tags throw warnings about \"unchecked or unsa

3条回答
  •  不知归路
    2021-01-17 14:43

    the best way to disable that warning is to stop using Java code in your JSPs. Start getting used to using JSTL or JSF instead (with custom tag libs as needed).

    But with legacy applications you're not going to be able to do that most likely, and you'll just have to live with the warnings. Of course you can add the -nowarn flag to the compiler, but this will disable ALL warnings, not just this one, which may be more than you want.

提交回复
热议问题