如何在eclipse中查看jsf / facelets元素的文档 [英] how to see docs for jsf/facelets elements in eclipse

查看:206
本文介绍了如何在eclipse中查看jsf / facelets元素的文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用helios 3.6.2。
我有一个使用网页编辑器打开的.xhtml

 <!DOCTYPE html PUBLIC -  // W3C // DTD XHTML 1.0 Transitional // EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
< html xmlns =http://www.w3.org/1999/xhtml
xmlns:f =http://java.sun.com/jsf/core
xmlns:h =http://java.sun.com/jsf/html
xmlns:ui =http://java.sun.com/jsf/facelets
>
< f:view>
< h:head>
...
< / h:head>当我将鼠标悬停在元素上时,例如

f:view,我只看到:


元素:f:view


而不是根据tld的以下描述:


创建一个JSF视图,这是一个
容器,其中包含作为视图一部分的所有
组件。

除非另有说明,所有
属性都接受静态值或EL
表达式。

有关更多详细信息,请参阅JSF
规范中的此类的javadoc


有没有办法我可以配置eclipse这样做?

解决方案

这取决于使用的插件。当前Eclipse版本(Helios)确实不支持这个框更新:这是肯定支持的,因为开普勒是第一个支持内置JSF 2.0的Eclipse版本)



当您使用可以按照这里。这个插件不幸的是不适用于Tomcat。


I am using helios 3.6.2. I have an .xhtml opened with Web Page Editor

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      >
<f:view>
<h:head>
...
</h:head>

when ever I hover over an element,e.g. f:view, I only see :

Element : f:view

rather than the description which suppose to be the following according to the tld:

Creates a JSF View, which is a container that holds all of the components that are part of the view.

Unless otherwise specified, all attributes accept static values or EL expressions.

See the javadoc for this class in the JSF Specification for further details.

Is there anyway I can configure the eclipse to do that?

解决方案

That depends on plugins used. Current Eclipse version (Helios) indeed doesn't support this out the box (update: this is definitely supported since Kepler which is the first Eclipse version with builtin JSF 2.0 support).

When you're using for example Glassfish 3 and use the Glassfish server plugin and the project has Glassfish set as target runtime, then you'll see autocompletion and documentation for all tags and attributes in the Facelet XHTML page. You will even get an extra rightclick menu option on the project New > XHTML file.

Here are some screens of a Eclipse+Glassfish project:


Tag tooltip:


Tag autocompletion:


Attribute autocompletion:


When using for example Tomcat as target runtime, this feature is not available. Even more, syntax highlighting doesn't work at all. You would have to manually add *.xhtml extension to JSP editor settings to get the highlighting to work by Window > Preferences > General > Content Types > Text > JSP. But that's it.

For JBoss AS 6 you need the JBoss Tools plugin which can be installed as described here. This plugin by the way unfortunately doesn't work out for Tomcat.

这篇关于如何在eclipse中查看jsf / facelets元素的文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆