How to make Eclipse IDE supports JSF 2.0

In Eclipse Ganymede (v3.4) or Galileo (v3.5), it supports until JSF 1.2 only. For JSF 2.0, upgrade your Eclipse to version Helios (v3.6) onward, it has full support of Java EE 6 support, including JSF 2.0.

Here’s a quick guide to show you how to enable JSF 2.0 features like code assist and visual JSF component editor in Eclipse IDE.

Tools Used

  • Eclipse 3.6
  • JSF 2.0.x

1. Eclipse Project Facets

To support JSF 2.0, you need to configure Eclipse project to support Web Tools Platform (WTP).

Steps to enable the Web Tools Platform (WTP) :

  • Right click on the project, choose “properties” –> “Project Facets“.
  • Check “Dynamic Web Module“, select version 2.5.
  • Check “Java“, choose version 1.6.
  • Check “JavaServer Faces“, choose version 2.0.
    eclipse-jsf-support
  • Click on the “further configuration…” link below to do the JSF configuration.
  • Create an user library and include the JSF 2.0 API and implementation libraries, jsf-api-xxx.jar and jsf-impl-xxx.jar.

    P.S You can get the JSF jars official JSF website.

    eclipse-jsf-support

    Updated on 8 Aug 2012
    For JSF 2.1.11, only one jar file javax.faces-2.1.11 is required.
    Done.

2. Demo

Now, Eclipse IDE is supporting the JSF 2.0 capabilities. Try it, in .xhtml file, click on the “Ctrl + Space“, it will prompts all available JSF 2.0 tags (code assist) automatically.

Furthermore, it add JSF 2.0 visual components to the web page editor as well, see figure below :
eclipse-jsf-support

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值