Java Eclipse 中没有创建 XHTML 选项
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22118403/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
No create XHTML option in Eclipse
提问by 6055
I am using Eclipse Kepler,version=4.3.0(tried with version=3.7.0 also).I tried using javax.faces-2.2.5.jar and javax.faces-2.2.1.jar.
我正在使用 Eclipse Kepler,version=4.3.0(也尝试使用 version=3.7.0)。我尝试使用 javax.faces-2.2.5.jar 和 javax.faces-2.2.1.jar。
Steps that i am following : File -> New -> Dynamic Web Project -> Dynamic web module version - 2.5(tried with 3.0 also),Configuration - JavaServerFaces v1.2Project -> Next -> Next -> Next -> JSF implementation Library - Added javax.faces-2.2.5.jar -> Finish.
我遵循的步骤:文件 -> 新建 -> 动态 Web 项目 -> 动态 Web 模块版本 - 2.5(也尝试使用 3.0),配置 - JavaServerFaces v1.2Project -> Next -> Next -> Next -> JSF implementation Library - 添加了 javax.faces-2.2.5.jar -> 完成。
After the project got created : Right Click on project name -> Properties -> Project facets : Dynamic Web Module - 2.5 Java - 1.5 Javascript - 1.0 Java Server faces - 1.2
创建项目后:右键单击项目名称 -> 属性 -> 项目方面:动态 Web 模块 - 2.5 Java - 1.5 Javascript - 1.0 Java Server faces - 1.2
I even did : Window > Preferences > General > Content Types > Text > JSP and then add *.xhtml as file association and set default encoding to UTF-8.
我什至做了:Window > Preferences > General > Content Types > Text > JSP 然后添加 *.xhtml 作为文件关联并将默认编码设置为 UTF-8。
Also, did Help -> Check for updates and updated eclipse.
此外,帮助-> 检查更新和更新的日食。
After doing all this , when i do Right Click on Web Content -> New ,there is no option for creating XHTML pages.
完成所有这些之后,当我右键单击 Web 内容 -> 新建时,没有用于创建 XHTML 页面的选项。
Please suggest if i am missing something.
请建议我是否遗漏了什么。
采纳答案by 6055
Answering my own question as i found the solution :
在找到解决方案时回答我自己的问题:
I am now getting the option to create XHTML pages. Steps that i followed :
我现在可以选择创建 XHTML 页面。我遵循的步骤:
Help -> Eclipse Marketplace -> Find(Jboss) -> Jboss tools(Kepler)4.1.1 Final. After installing this, i am getting the option to create XHTML pages.
帮助 -> Eclipse Marketplace -> Find(Jboss) -> Jboss tools(Kepler)4.1.1 Final。安装后,我可以选择创建 XHTML 页面。
回答by nitind
Go back and remove that content type association. Then, for JavaServer Faces pages, use the New JSP wizard, picking one of the JSF templates and giving it the filename extension you want.
返回并删除该内容类型关联。然后,对于 JavaServer Faces 页面,使用 New JSP 向导,选择 JSF 模板之一并为其指定所需的文件扩展名。
回答by razor
I was looking for create xhtml option and found this post. Thanks. Installing JBoss Tools does give the option to create xhtml pages. Alternatively, you can also use the "New-->File" option in eclipse to create a new file and give it xhtml extension. This will not require you to install JBoss tools in eclipse.
我正在寻找 create xhtml 选项并找到了这篇文章。谢谢。安装 JBoss Tools 确实提供了创建 xhtml 页面的选项。或者,您也可以使用 eclipse 中的“New-->File”选项来创建一个新文件并为其赋予 xhtml 扩展名。这不需要您在 eclipse 中安装 JBoss 工具。
Just noticed the question is from 2014. So I hope this helps some one new to JSF just like me.
刚刚注意到这个问题来自 2014 年。所以我希望这对像我一样的 JSF 新手有所帮助。
回答by mdfst13
After installing a new version of Eclipse, the create XHTML file option wasn't where I remembered it. I had already installed JBoss Tools. Under this version (the March 2019 Eclipse with JBoss Tools added), the option is found under File -> New -> Other -> JBoss Tools Web -> XHTML Page
.
在安装了新版本的 Eclipse 后,创建 XHTML 文件选项不是我记得的地方。我已经安装了 JBoss Tools。在此版本(添加了 JBoss 工具的 2019 年 3 月 Eclipse)下,该选项位于File -> New -> Other -> JBoss Tools Web -> XHTML Page
.
After you select File -> New -> Other
, the wizard that shows includes a "type filter text" box. If you enter XHTML there, it will show the relevant option and where it is found. If I had noticed that first, that would have been easier than Googling and would have produced the correct answer. Presumably that will continue to work even after future updates so long as there is some XHTML wizard available.
选择 后File -> New -> Other
,显示的向导将包含一个“类型过滤器文本”框。如果您在那里输入 XHTML,它将显示相关选项及其所在位置。如果我首先注意到这一点,那会比谷歌搜索更容易,并且会产生正确的答案。据推测,即使在未来更新之后,只要有一些 XHTML 向导可用,它也会继续工作。