Why WebSphere 6.1 (JDK 1.5 Compliant) compiles my JSPs as JDK 1.4?

爱⌒轻易说出口 提交于 2019-12-08 05:50:43

问题


Our web application is JDK 1.5 compliant, and is running succesfuly on WebSphere 6.1

However, some JSPs we have that contain Java code in 1.5 syntax fail to compile by WebSphere.

It seems that for some reason, WebSphere treats the JSPs as 1.4 complient and fails to compile.

Any idea why and how to solve this? (Stop writing Java in JSPs is one answer, what else?)


回答1:


if you are using RAD, open web.xml go to extensions tab and add new jsp attribute jdkSourceLevel and value 15 (no dot in it)

it will change ibm-web.xml and entry would look like

  <webApp href="WEB-INF/web.xml#WebApp_ID"/>
  <jspAttributes xmi:id="JSPAttribute_1" name="jdkSourceLevel" value="15"/>



回答2:


Have a look at this page of the documentation. It claims there's a "JDK source level" option:

JDK source level
Specifies the source level at which the Java compiler compiles JSP Java sources. Valid values are 13, 14, and 15. The default value is 13, which specifies source level 1.3.



来源:https://stackoverflow.com/questions/2036544/why-websphere-6-1-jdk-1-5-compliant-compiles-my-jsps-as-jdk-1-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!