`

Use the <f:verbatim> tag for nested HTML.

阅读更多
Use the <f:verbatim> tag for nested HTML.

在写JSF代码时,发现老是有以下的异常报出:
Component with id '_idJsp7' (org.apache.myfaces.taglib.html.HtmlPanelGroupTag tag) and path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /pages/calculator.jsp][Class: javax.faces.component.html.HtmlPanelGroup,Id: _idJsp7]}renders it's children, but has embedded JSP or HTML code. Use the <f:verbatim> tag for nested HTML. For comments use <%/* */%> style JSP comments instead of <!-- --> style HTML comments.

当时真是一看到红色的异常血压也就蹭蹭地上升,也就没能静下心来看看这些异常是什么意思,就条件反射地Google一下.可Google出来的又全都是英文,磕磕绊绊地看了会就放下心了.

现在心情好些再来看这个问题时,发现它远没有想像中那么可怕.人家异常里也说的很清楚.就是在写jsf页面时,有些JSF组件(如grid_panel)里是不能嵌套HTML代码了.若想硬往里写就只得用<f:verbatim> tag了.

http://gceclub.sun.com.cn/prodtech/javatools/jscreator/reference/docs/help/ui_elements/palette/jsf-val-conv/f_verbatim.html给的链接里有如下描述:
    此高级组件是一个定制 <f:verbatim/> 标记,用于将 HTML 元素添加到某些组件中,并使 HTML 元素具有这些组件的行为。将 HTML 标记包装在 <f:verbatim/> 标记中,使其具有 JavaServer Faces 组件的行为,这样便解决了同时包含 JavaServer Faces 组件和 HTML 元素的页中出现的一些问题。

  • 标记组件更易于用来将 HTML 标记添加到 JSP 页面。
       这样又顺着想起了另一个问题:现在这样是在JSP中用JSF时出的问题,那若用faclet是不是不会有这个问题了呢?若没有这个异常报出,那么这个异常也就是有JSF生命周期里的Render阶段报出啦?
4
1
分享到:
评论
1 楼 yuchang314 2009-05-08  
[img][/img]
引用

相关推荐

    JSF标签库教程.ppt

    * 使用 JSF 标签需要在jsp 文件中添加 Taglib 指令:&lt;%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %&gt;&lt;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %&gt; * &lt;f:view&gt; 创建顶层视图 * &lt;h:...

    30天打造更亲和力网站.rar

    How to use this License for your documents.............77 Translations..........79 Chinese.......79 Estonian......79 Finnish........79 French.........79 German.......79 Italian..........79 ...

    《JSF标签》简体中文版

    **核心标签** 是独立于JSF的,它们在任何基于JSP的环境中都能使用,如`&lt;f:view&gt;` 和 `&lt;f:verbatim&gt;`。**JSF组件标签** 则是JSF特有的,它们提供了丰富的UI组件,如输入框、下拉列表、表格等。 在《JSF标签》简体...

    sublime中利用Djaneiro插件可以补全的字段列表介绍

    - **verbatim**:`verbatim` - `{% verbatim %}{% endverbatim %}` - **widthratio**:`widthratio` - `{% widthratio %}` - **with**:`with` - `{% with as %}{% endwith %}` - **trans**:`trans` - `{% trans %}...

    Java Server Faces API 组件标签 API Reference 速查手册

    Java Server Faces API 组件标签 API Reference 速查手册 HTML_BASIC RenderKit javax.faces.Command ...f:verbatim f:view h:column h:commandButton h:commandLink h:dataTable h:form h:graphicImage

    利用c#文件查找,删除,创建,方法.

    如果要在多行定义路径,可以使用字符串连接或者使用`@`符号来创建一个“verbatim”字符串,允许你在多行写代码,如下所示: ```csharp Directory.CreateDirectory(@"C:\\A"); ``` 2. **目录操作**: `...

    TWIKI的简易教程~

    使用`&lt;verbatim&gt;`和`&lt;/verbatim&gt;`或`&lt;pre&gt;`和`&lt;/pre&gt;`包裹文本,保持原始格式不变,适用于代码块: ``` &lt;verbatim&gt; class CatAnimal { void purr() { &lt;code here&gt; } } &lt;/verbatim&gt; ``` ### 2. 列表和排序列表 -...

    Jericho HTML Parser

    including some common server-side tags, while&lt;br&gt;reproducing verbatim any unrecognised or invalid HTML.&lt;br&gt;Also provides high-level HTML form manipulation functions.

    TWIKI的簡介

    8. Verbatim 模式: 逐字模式,在一些代码两端使用 &lt;verbatim&gt; 和 &lt;/verbatim&gt; 标签。 9. 分割符: 在一行的开头,用三个连续的'-'符号。 10. 列表: 一行开头是三个空格,加一个'*'号,再加一个空格。 11. 多级列表: 6...

    Diamond_ALL

    June 1991&lt;br&gt;&lt;br&gt; Copyright (C) 1989, 1991 Free Software Foundation, Inc.&lt;br&gt; 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA&lt;br&gt; Everyone is permitted to copy and distribute verbatim copies&lt;br&gt; ...

    Laravel开发-laravel-blade

    -- 不转义输出:&lt;b&gt;John Doe&lt;/b&gt; --&gt; ``` ### 4. **Blade 组件与插槽** Blade 的组件(Components)和插槽(Slots)是构建可复用视图元素的关键。组件可以通过定义一个类并使用 `@component` 指令来创建,而插槽则...

    hibernate-shards.jar

    on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may ...

    Universal-USB-Installer

    The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus...

    gvim常用插件及其配置文件配置(下载解压即可使用)

    array changebar eqlist geometry inputenc newalg polski verbatim .vim/ftplugin/latex-suite/templates: article.tex IEEEtran.tex report.tex report_two_column.tex .vim/indent: tex.vim .vim/keymap: ....

    HttpClient以及获取页面内容应用

    List&lt;NameValuePair&gt; formparams = new ArrayList&lt;NameValuePair&gt;(); formparams.add(new BasicNameValuePair("username", "admin")); formparams.add(new BasicNameValuePair("password", "123456")); ...

    WizFlow网页编辑

    on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may ...

    htmlparser 使用指南 入门 必读htmlparser 使用指南 入门 必读htmlparser 使用指南 入门 必读

    例如,如果要提取所有链接,可以创建一个过滤器,只保留`&lt;a&gt;`标签,然后在访问者中处理这些链接。 总的来说,HTMLParser是一个强大的工具,适用于处理和分析HTML文档。通过理解其数据结构和核心概念,开发者可以...

Global site tag (gtag.js) - Google Analytics