Question

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.

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.

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

I even did : Window > Preferences > General > Content Types > Text > JSP and then add *.xhtml as file association and set default encoding to 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.

Please suggest if i am missing something.

Was it helpful?

Solution

Answering my own question as i found the solution :

I am now getting the option to create XHTML pages. Steps that i followed :

Help -> Eclipse Marketplace -> Find(Jboss) -> Jboss tools(Kepler)4.1.1 Final. After installing this, i am getting the option to create XHTML pages.

OTHER TIPS

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.

enter image description here

enter image description here

enter image description here

Just noticed the question is from 2014. So I hope this helps some one new to JSF just like me.

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.

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top