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>


  • 相关阅读:
    DevExpress中设置PanelControl背景的方法
    ArcEngine选中面要素样式修改
    DEV winform treelist设置背景图像
    React-Native运行知乎日报遇到的问题
    winform程序自动升级
    jquery图片轮播效果(unslider)
    Orchard搜索与索引
    网络版会飞的小鸟
    jQuery event的复制粘贴的坑
    记一次有趣的互联网事件及console.log~
  • 原文地址:https://www.cnblogs.com/real-psyyyy1015/p/8690408.html
Copyright © 2011-2022 走看看