为什么 WebSphere 6.1(兼容 JDK 1.5)将我的 JSP 编译为 JDK 1.4?
我们的 Web 应用程序符合 JDK 1.5,并且在 WebSphere 6.1 上成功运行。
但是,我们拥有的一些包含 1.5 语法中的 Java 代码的 JSP 无法通过 WebSphere 进行编译。
似乎由于某种原因,WebSphere 将 JSP 视为兼容 1.4,因此无法编译。
知道为什么以及如何解决这个问题吗? (停止在 JSP 中编写 Java 是一个答案,还有什么?)
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?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用 RAD,请打开 web.xml,转到扩展选项卡并添加新的 jsp 属性 jdkSourceLevel 和值 15(其中没有点),
它将更改 ibm-web.xml 并且条目看起来像
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
查看 文档的此页面。它声称有一个“JDK源级别”选项:
Have a look at this page of the documentation. It claims there's a "JDK source level" option: