Eclipse autocomplete (content assist) with facelets (jsf) and xhtml

前端 未结 10 1140
时光说笑
时光说笑 2020-11-27 02:45

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 m

相关标签:
10条回答
  • 2020-11-27 03:34

    Have you thought about MyEclipse? It isn't free, but it is a pretty nice tool. It helped a lot when I developed with JSF.

    0 讨论(0)
  • 2020-11-27 03:38

    In Eclipse Indigo (3.7) adding *.xhtml as a jsp does not work.

    Adding a project facet solves the issue:

    Right click on the project -> Preferences -> Project Facets -> Click on "JavaServer Faces", version should most probably be 2.0.

    Then it asks for a library, you can click on "disable...", because most probably you already would have the jars configured. I don't have mine as a library so I ignored that part.

    Screenshot: enter image description here

    0 讨论(0)
  • 2020-11-27 03:39

    I have install JBoss Tool for JSF coding purpose.But in *.XHTML it was not showing content assist for ManagedBean..so I did following steps that's work for me.

    For my project this steps worked.

    1)Right click on project --> Configure-->Add JSF Capabilities.. Step-by-step procedure (Vailaaa!!! Problem Solve).. Go to Xhtml file and try to code #{m^anagedBeans.HelloJSF()} where (^) this is the sysmbol there you just have to "Ctrl+space" Content Assist will work.here

    0 讨论(0)
  • 2020-11-27 03:43

    Check that you have include primefaces namespace! So your html tag could look like following:

    <html 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:p="http://primefaces.org/ui">
    

    I have been using in Eclipse Luna and primefaces 5.

    0 讨论(0)
提交回复
热议问题