Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314098 - JSF Content Assist for xhtml files
Summary: JSF Content Assist for xhtml files
Status: NEW
Alias: None
Product: Java Server Faces
Classification: WebTools
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal with 2 votes (vote)
Target Milestone: Future   Edit
Assignee: Ian Trimble CLA
QA Contact:
URL:
Whiteboard: Maven
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-24 07:32 EDT by Ralph Soika CLA
Modified: 2011-04-01 17:29 EDT (History)
4 users (show)

See Also:


Attachments
Content assist - Namespace (10.63 KB, image/png)
2010-05-24 15:58 EDT, Raghunathan Srinivasan CLA
no flags Details
Content Assist tags (4.55 KB, image/png)
2010-05-24 15:59 EDT, Raghunathan Srinivasan CLA
no flags Details
The facet of an archetype generated webapp project (85.74 KB, image/png)
2010-08-01 02:19 EDT, Justin Light CLA
no flags Details
Code assist with JSP editor. (111.40 KB, image/png)
2010-08-01 02:20 EDT, Justin Light CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Soika CLA 2010-05-24 07:32:21 EDT
Build Identifier: 20100218-1602

I hope this is the right place to report the following bug:

Why there is no default JSF support for xhtml files?
There are a lot of postings in the community how to configure Eclipse to enable the content assist for xhmtl files in a jsf project. This file type is typical in JSF/JEE applications. I often wrote blogs about this issue how to solve it. 
For example see this short description in my last blog entry:

http://www-02.imixs.com/roller/ralphsjavablog/entry/eclipse_galileo_jsf_content_assist

My Question is : 
Why is there no default settings concerning the Content type '.xhtml' and the Editor file association?
It seems to me that it would be a very easy step to add the additional content typ to the responsible plugin?
I did not know which plugin is responsible for this behavior so I can not give any more details about a possible solution for next eclipse releases.


Reproducible: Always

Steps to Reproduce:
1. install latest eclipse (galileo)
2. start a jee project (e.g. based on maven)
3. try the "code completion" feature in a .xhtml file - JSF tags are not availalbe
Comment 1 Carl Anderson CLA 2010-05-24 09:04:10 EDT
I think this may belong to WTP Source Editing, but I believe it should go to the JSF group first to make sure that this is something that they truly desire (or perhaps have a reason for not doing).
Comment 2 Raghunathan Srinivasan CLA 2010-05-24 15:58:57 EDT
Created attachment 169722 [details]
Content assist - Namespace
Comment 3 Raghunathan Srinivasan CLA 2010-05-24 15:59:18 EDT
Created attachment 169723 [details]
Content Assist tags
Comment 4 Raghunathan Srinivasan CLA 2010-05-24 16:01:32 EDT
Content Assist for JSF 2.0 tags and their attributes is available on an XHTML file in a Dynamic Web Project that has the JSF 2.0 Facet. This is available as part of the JSF Tools sub-project in the WTP Project. WTP also includes a File association between .xhtml and the Web Page Editor. This is not set as the default editor.

Steps overview:
1) Get the WTP 3.2 RC2 build, http://download.eclipse.org/webtools/downloads/drops/R3.2.0/S-3.2.0RC2-20100520232028/

2) Create a Dynamic Web Project. Apply the JSF 2.0 facet.
3) Create a XHTML page. Open it in the Web Page Editor (optional)
4) Use content assist to add the namespace to the JSF 2.0 libs. See attachment, CA-Namespace.png 
5) Use  content assist to add a JSF tag. See attaachemnt, CA_tags.png

Please let us know if you still see issues with this feature.
Comment 5 Ralph Soika CLA 2010-05-24 17:38:19 EDT
Hi,
Ok - I believe you that your steps overview will work.
I think that we are stumbling into this problem only wen we are working with maven projects. 
I know about a lot of developers who need all to reconfigure the file association manually in eclipse for the .xhtml file types. 
xhtml files are not associated with text->jsp in the preferences General->content types per default.
And the problem is that if you are working with a maven project you can not activate the WTP or use the settings for a dynamic web project. This results into a lot of other problems. 
So in this situation (working with maven projects and the m2eclipse plugin) your maven (web) project defaults to a java facet. This is fine and you can work perfect with java files and you can work perfect with html files and for example with css files. All this files are associated with the right editor. content assist works great.

The only file type which will be unknown by eclipse is the .xhtml file.
It is not known as a content type. And you need to reconfigure your project and workspace preferences manually. 

Maybe that I am totally wrong. But if you search the internet for this topic (content assist and xhtml files) you will see that there are a lot of discussions and guidelines from many people.  Maybe it is possible to change this in the next release?
xhtml files should be in my opinion associated with the jsp editor per default
Comment 6 Justin Light CLA 2010-08-01 02:18:12 EDT
Does it work to associated the '.xhtml' file with the jsp editor?
I 'm now working with Eclipse Helios release and the same problem appears to be there. I tried to open the '.xhtml' file with JSP editor, web editor and many other editors. The code assist, however, is always absent from work.

I guess the code assist of '.xhtml' file is not activated by the content type of a file, but by the 'JSF'facet of a project. That asks for more reconfiguring jobs of maven users. And some times the reconfiguration could fail(It always fail on my computer).

Do I have any further information to know about?
Comment 7 Justin Light CLA 2010-08-01 02:19:47 EDT
Created attachment 175659 [details]
The facet of an archetype generated webapp project
Comment 8 Justin Light CLA 2010-08-01 02:20:48 EDT
Created attachment 175660 [details]
Code assist with JSP editor.
Comment 9 Justin Light CLA 2010-08-01 02:24:23 EDT
Eclipse Web Developer Tools

Version: 3.2.1.v201007071800-7O7CFbBEMf84nSIGRvUy2Pq4fbXf
Build id: 20100615235519
Comment 10 Raghunathan Srinivasan CLA 2010-08-24 14:41:34 EDT
Thanks for the all the feedback. We do plan to make the JSF project Maven friendly in the Indigo release.
Comment 11 Ian Trimble CLA 2011-04-01 17:29:16 EDT
For an XHTML file, content assist is being provided only for the root namespace (e.g. "http://www.w3.org/1999/xhtml").

Work has been done to make the JSP content model aware of the fact that certain special tags (taglib) provide additional tag libraries that may also offer additional content assist.

Similar work has not yet been done for XHTML, is significant, and cannot be undertaken this late in the 3.3 release cycle (as we approach M7). For now, the story is as it always has been for JSF Tools support of tag libraries; we require the JSF facet to be present and configured (which, in turn, requires the web facet).

We will try to address this in a future release. We are always willing to review contributions and suggestions.