zoukankan      html  css  js  c++  java
  • java ee 第四周作业

    一、分析hello1example  程序

    ***  index.xhtml部分

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

    <!--声明了文档的根元素是 html,它在公共标识符被定义为 "-//W3C//DTD XHTML 1.0 Transitional//EN" 的 DTD 中进行了定义。浏览器将明白如何寻找匹配此公共标识符的 DTD。如果找不到,浏览器将使用公共标识符后面的 URL 作为寻找 DTD 的位置。

    而这句<html xmlns="http://www.w3.org/1999/xhtml">,是在文档中的<html> 标签中使用 xmlns 属性,以指定整个文档所使用的主要命名空间-->


    <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html">
    <!--
    这是一个W3C的标准 lang代表language,lang="en","en" 即english ;
    xmlns 属性可以在文档中定义一个或多个可供选择的命名空间。该属性可以放置在文档内任何元素的开始标签中。该属性的值类似于 URL,它定义了一个命名空间,浏览器会将此命名空间用于该属性所在元素内的所有内容
    -->
    <h:head> <title>Facelets Hello Greeting</title> </h:head> <h:body> <h:form> <h:graphicImage url="#{resource['images:duke.waving.gif']}" alt="Duke waving his hand"/> <h2>Hello, my name is Duke. What's yours?</h2> <h:inputText id="username" title="My name is: " value="#{hello.name}" required="true" requiredMessage="Error: A name is required." maxlength="25" /> <p></p> <h:commandButton id="submit" value="Submit" action="response"> </h:commandButton> <h:commandButton id="reset" value="Reset" type="reset"> </h:commandButton> </h:form> ... </h:body> </html>


    <!--这部分主要是写文档要显示的内容,包括标题与详细内容,以及一些格式设计-->

    ***** response.xhtml部分
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html lang="en"
          xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://xmlns.jcp.org/jsf/html">
        <h:head>
            <title>Facelets Hello Response</title>
        </h:head>
        <h:body>
            <h:form>
                <h:graphicImage url="#{resource['images:duke.waving.gif']}"
                                alt="Duke waving his hand"/>
                <h2>Hello, #{hello.name}!</h2>
                <p></p>
                <h:commandButton id="back" value="Back" action="index" />
            </h:form>
        </h:body>
    </html>


  • 相关阅读:
    app.config应该放哪?
    Connection 和Dispose的学习日志
    简单的sqlhelper的学习日志
    EF 事务(非分布式事务)
    Angularjs 地址联动2.1.1
    C# 如何物理删除有主外键约束的记录?存储过程实现
    C# 枚举基本用法及扩展方法
    JS 去除重复元素的方法
    MVC4程序运行报错
    ASP.NET MVC4 & Entity Framework 6.0 IIS 部署出错解决方案
  • 原文地址:https://www.cnblogs.com/real-psyyyy1015/p/8690408.html
Copyright © 2011-2022 走看看