html:link 各个属性解释及用法
<html:link> 标签用于生成HTML <a> 元素。<html:link> 在创建超链接时,有两个优点:
(1) 允许在URL 中以多种方式包含请求参数。
(2) 当用户浏览器关闭Cookie 时,会自动重写URL,把SessionID 作为请求参数包含在URL 中,用于跟踪用户的Session 状态。
<html:link> 标签有以下重要属性:
(1) forward:指定全局转发链接。
(2) href:指定完整的URL 键接。
(3) page:指定相对于当前网页的URL。
<html:rewrite> 用于输出超链接中的URI部分,但它并不生成HTML <a> 元素。URI指的是URL 中协议、主机和端口以后的内容。URI 用于指定具体的请求资源。例如,对于URL:HTTP://localhost:8080/HtmlBasic.do,它的URI为 /HtmlBasic.do
示例:
1、创建全局转发链接
首先,在Struts-config.xml 中<global-forwards> 元素中定义一个<forward> 元素:
<global-forwards>
<forward name = "index" path="/index.jsp"/>
</global-forwards>
接着,在JSP 文件中创建<html:link> 标签:
<html:link forward="index">
Link to Global ActionForward
</html:link>
<html:link> 标签的forward 属性和<global-forwards> 元素中的<forward> 子元素匹配。以上代码生成如下HTML 内容:
<a href="/index.jsp" mce_href="index.jsp">Link to Global ActionFoward</a>
值得注意的是,<html:link> 的forward 属性只引用Struts-config.xml 配置文件中<global-forwards>内的<forward> 子元素,如果引用<action> 内的<forward> 子元素,在运行时将会抛出异常:
Cannot c
相关文档:
程序集名
保留
保留
备注
窗口程序集1
子程序名
返回值类型
公开
备注
_按钮2_被单击
写到文件 (“c:\ecode.txt”, 到字节集 (超级编辑框1.内容))
执行 (4, “ecode_To_html.exe”, “c:\ecode.txt& ......
<html:html>标签有一个 lang 属性,用于显示用户使用的语言:
<html:html lang="true">
如果客户浏览器使用中文,那么以上代码在运行时将被解析为普通的 HTML 代码:
<html lang="zh-CN">
解释:当 lang 属性为 "true ......
有时页面需要获得用户浏览器的高度才能确定内容显示在哪里,代码
<div style="position:absolute; left:0; top:expression(document.body.clientHeight/2-document.body.clientHeight/4)">
</div>
中,expression(document.body.clientHeight/2)即为获得浏览器高度再除以2 ......
最近本来是要去那嵌入式课的,但是那课竟然说人数太少,开不了,靠。所以这两天只能自己研究点东西了。记得自己以前就想动手写一个关于dom的解析引擎,只怪自己太懒,一直没动笔。最近在家也没什么事做,就自己动手写一个,花了一天时间写的差不多了,正好锻炼自己的c++水平吧。
&nb ......
Example:
1.<!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]-->
2.<!--[if IE]> 所有的IE可识别 <![endif]-->
3.<!--[if IE 5.0]> 只有IE5.0可以识别 <![endif]-->
4.<!--[if IE 5]> 仅IE5.0与IE5.5可以识别 <![endif]-->
5.<!--[if gt IE 5.0]> IE ......