5

I develop jsf xhtml pages with facelets, and I always had code assist for all the taglibs i declared i my xhtml root element (h, f etc..)

But, since, like 30 minutes, when i ctrl+space i only have regular html and ui:* proposals.

I didn't change anything. It just broke, no error message, nothing.

I searched the web, but nothing either, or i am not searching right.

Please help me :)

ps : here's an example of one of my xhtml page's header :

<?xml version="1.0" encoding="ISO-8859-1"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml" 
 xmlns:ui="http://java.sun.com/jsf/facelets" 
 xmlns:h="http://java.sun.com/jsf/html"
 xmlns:f="http://java.sun.com/jsf/core" 
 xmlns:a4j="http://richfaces.org/a4j" 
 xmlns:r="http://richfaces.org/rich"
 xmlns:c="http://java.sun.com/jstl/core"
 xmlns:s="http://jboss.com/products/seam/taglib">
Buhake Sindi
  • 87,898
  • 29
  • 167
  • 228
Maxime ARNSTAMM
  • 5,274
  • 10
  • 53
  • 76

5 Answers5

13
  1. Right click on the project, choose properties, select “Project Facets“, make sure the “JavaServer Faces” is checked. If it is checked go to step 2.

  2. Create an user library and include the JSF API and implementation library, jsf-api-xxx.jar and jsf-impl-xxx.jar. It will add the JSF capabilities to your project.

If you don't understand click: http://www.mkyong.com/jsf2/eclipse-ide-xhtml-code-assist-is-not-working-for-jsf-tag/

Best Regards.

kinkajou
  • 3,664
  • 25
  • 75
  • 128
  • 1
    Adding xhtml to JSP content types worked for me. Window > Preferences > General > Content Types > Text > JSP. and adding *.xhtml file association from add button enables code assist by making *.xhtml file look like *.jsp but will not provide full feature of accessing bean variables from the page i.e .xhtml file. – kinkajou Feb 19 '11 at 02:36
  • i only needed part 1. then i had to click on further configuration --> download library, and i choose the right jar... perfect, thx! – Joergi Aug 01 '12 at 14:25
3

Firstly:

  1. Check the content assist options.
  2. Check the Error Log and search for any messages you suspect are related. As well as Google, check bugs.eclipse.org.

It hasn't been unknown for bugs to leave workspaces with cached state that can adversely affect behaviour. You can try these tricks:

  1. Close and reopen the affected project.
  2. Start the workspace with the -clean option.
  3. Delete the project (but not contents under!) and reimport it as an existing project.
  4. If the workspace is caching something broken, you may be able to delete it by poking around in the workspace/.metadata/.plugins directory. Most of that stuff is fairly transient (though backup first and watch for deleted preferences).
McDowell
  • 107,573
  • 31
  • 204
  • 267
2

Adding xhtml to JSP content types worked for me. Window > Preferences > General > Content Types > Text > JSP.

jcasalruiz
  • 117
  • 2
  • 8
1

Ok, here's the solution that worked for me :

ProjectWebApp > properties > Projet Facets > switched "Java 5.0" to 6.0

That did the trick.

Maxime ARNSTAMM
  • 5,274
  • 10
  • 53
  • 76
1

My solution for similar problem when migrating from the JBoss Developer Studio version 1 to version 3:

Check xmlns entries, they should look as follows:

...
xmlns:a="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">

The old ones in my case were:

...
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
xmlns:a="https://ajax4jsf.dev.java.net/ajax">
James A Mohler
  • 11,060
  • 15
  • 46
  • 72