Eclipse自动完成(内容辅助)with facelets(jsf)和xhtml [英] Eclipse autocomplete (content assist) with facelets (jsf) and xhtml

查看:102
本文介绍了Eclipse自动完成(内容辅助)with facelets(jsf)和xhtml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何激活eclipse(3.5,WTP)内容帮助JSF(1.2)标签的.xhtml页面使用面孔?
它的工作原理是.jsp文件,但不适用于xhtml。



我很多,在许多地方(包括MyFaces wiki)都说 - Eclipse无法使用xhtml和facelets



由于这可以与.jsp文件一起使用,我认为可能有一些机制来激活该内容的协助。 >

我开始研究一个已经有很大代码库的项目,所以改变扩展名不是一个选择。额外的插件是不受欢迎的,但如果没有其他工作,可以接受。



(我问这个问题来验证是否有人没有找到一个机智的解决方案来解决这个问题 - 否则我知道这是不可能的)

解决方案

在提出问题后(一小时后我开始尝试解决它):



窗口>首选项>一般>内容类型>文字> JSP>添加(xhtml)



使文件被视为jsp文件。因此,当它们使用JSP编辑器打开时,自动完成在 .tld 格式(< h:< f )作品。 Facelets和仅限Facelets的标签仍然不起作用。应在项目中的某个地方添加他们的 .tld 等价物。可以在此处找到Facelet的tld。



另外一个更复杂的解决方案就是描述 here


How to activate eclipse (3.5, WTP) content assist in .xhtml pages for JSF (1.2) tags, using facelets? It works in .jsp files, but not xhtml.

I google a lot, and in many places (including MyFaces wiki) it is said - "Eclipse can't work with xhtml and facelets"

Since this works with .jsp files, I assume there might be some mechanism with which to activate that content assist.

I started working on a project, which has already a large codebase, so changing the extensions is not an option. Additional plugins are aslo undesirable, but acceptable if nothing else works.

(I'm asking the question to verify if someone hasn't found a witty workaround to this issue - otherwise I know it's not possible)

解决方案

Found the solution pretty quickly after asking the question (and an hour after I started attempting to solve it):

Window > Preferences > General > Content Types > Text > JSP > Add (xhtml)

Makes the files be treated as jsp ones. Thus when they are opened with the JSP editor, the autocomplete of any tag library that has its definitions in .tld format (<h: and <f for example) works. Facelets, and facelets-only tags still don't work. Their .tld equivalents should be added somewhere in the projects. Facelet's tld can be found here.

Another, a bit more complex solution is described here.

这篇关于Eclipse自动完成(内容辅助)with facelets(jsf)和xhtml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆