手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>程序设计>Java技术>列表

Struts学习笔记: Html标签库学习(Html基本标签)

来源:互联网 作者:west263.com 时间:2008-02-23
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

1. <html:html>
<html:html lang="true">
</html:html>
=> 转为Html后(下同):
<html lang="zh-CN">
</html>
2. <html:base/>
<html:base/>
=>
<base href="http://localhost/AddressBook/regGuest.jsp">
//本页面的绝对地址
3. <html:link>
<%
String cheyo = "hehehe";
pageContext.setAttribute("coolName", cheyo);
%>
<html:link forward="success" paramId="name" paramName="coolName">成功页面</html:link><p/>
<html:link page="/here.jsp?bigId=3&amp;smallId=7">Here</html:link><p/>
<html:link href="http://www.csdn.net" paramId="name" paramName="coolName">CSDN首页</html:link><p/>
=>
<a href="/AddressBook/hello.jsp?name=hehehe">成功页面</a><p/>
<a href="/AddressBook/here.jsp?bigId=3&amp;smallId=7">Here</a><p/>
<a href="CSDN'>http://www.csdn.net?name=hehehe">CSDN首页</a><p/>

/*
<html:link forward="success" paramId="bookName" paramName="name"
paramProperty="book"></html:link> //用book这个JavaBean的name属性的值作为名为bookName参数的值
<html:link page="hello.jsp" name="map"></html:link> //map有一个HashMap对象,可以以于传递一个参数名多个参数值
*/
4. <html:rewrite>
<%
String cheyo = "hehehe";
pageContext.setAttribute("coolName", cheyo);
%>
Rewrite Forward: <html:rewrite forward="success" paramId="name" paramName="coolName"/><p/>
Rewrite Page: <html:rewrite page="/here.jsp?bigId=5&amp;smallId=3"/><p/>
Rewrite Href: <html:rewrite href="http://www.csdn.net" paramId="name" paramName="coolName"/><p/>
=>
Rewrite Forward: /AddressBook/hello.jsp?name=hehehe<p/>
Rewrite Page: /AddressBook/here.jsp?bigId=5&amp;smallId=3<p/>
Rewrite Href: http://www.csdn.net?name=hehehe<p/>
5. <html:img>
<html:img page="/struts.gif"/><p/> /* 相对于Web应用根目录 */
<html:img src="/struts.gif" paramId="name" paramName="coolName"/><p/>/* 相对于服务器根目录 */
<html:img page="/struts.gif?name=oyeah"/><p/>
=>
<img src="/AddressBook/struts.gif"><p/>
<img src="/struts.gif?name=hehehe"><p/>
<img src="/AddressBook/struts.gif?name=oyeah"><p/>

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!