使用 WTP 编辑 Eclipse JSP 找不到变量和类定义
我正在使用 Eclipse(OS X 上的 3.6.1)来编写 Java 和 JSP。不幸的是,我们的 JSP 包含大量 Java —— 我更愿意在 .java 文件中保留尽可能多的 Java,但这不会改变,至少在一段时间内不会改变。
我最近安装了 Web Tools Project (WTP) 1.1 和 1.2 版,以便在编辑 JSP 时获得更好的功能。然而,它并没有做很多我期望的事情。例如,我无法在 JSP 中选择类名并按 F3(不确定函数名)来打开类定义。此外,在许多情况下,Eclipse/WTP 不知道 JSP 文件中存在的变量和/或类定义,这些文件包括包含变量或类引用的文件。也就是说,它报告 “无法解析为变量”等。我搜索了 Eclipse 文档——尤其是 http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.wst.doc.user/topics/overview.html< /a> - 有关如何配置 WTP 以显示此信息的指导,但无济于事。
谢谢 亚瑟
I'm using Eclipse (3.6.1 on OS X) to write Java and JSP. Unfortunately, our JSPs contain a lot of Java -- I'd prefer to keep as much Java as possible in .java files, but that won't change, at least for a while.
I recently installed the Web Tools Project (WTP) version 1.1 and 1.2 to get better functionality when editing JSP. However, it doesn't do many things I'd expect. E.g., I cannot select a class name in the JSP and hit F3 (unsure of the function name) to open the class definition. In addition, in many cases Eclipse/WTP isn't aware of variables and/or class definitions that are present in JSP files that include the file containing the variable or class reference. That is, it reports
" cannot be resolved to a variable", etc. I searched the Eclipse documentation -- especially http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.wst.doc.user/topics/overview.html -- for guidance on how to configure WTP to present this info, to no avail.
Thanks
Arthur
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
遗憾的是,Eclipse 无法确定您正在编辑的片段文件包含在哪个主 JSP 文件(如果有)中,并且应该用于此目的。
Unfortunately there's no way for Eclipse to be sure which main JSP file, if any, the fragment file you're editing is included in, and should be used for this purpose.