常用的HTML标签有:
<html:base /> <html:text /> <html:password />
<html:radio /> <html:select /> <html:checkbox />
<html:textarea /> <html:form /> <html:submit />
<html:reset />
1、<html:base />
<html:base />
替换
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<base href="<%=basePath%>">
2、<html:text />
<%
com.Person p = new com.Person();
pageContext.setAttribute("per",p);
%>
<html:text name="per" property="name" />
3、<html:password />
<%
com.Person p = new com.Person();
pageContext.setAttribute("per",p);
%>
<html:password name="per" property="name" />
4、<html:radio />
<%
com.Person p = new com.Person();
pageContext.setAttribute("per",p);
%>
<html:radio name="per" property="name" value="male">男</html:radio>
<html:radio name="per" property="name" value="female">女</html:radio>
5、<html:select />
<%
com.Person p = new com.Person();
pageContext.setAttribute("per",p);
%>
<html:select name="per" property="city">
<html:option value="北京">北京</html:option>
<html:option value="大庆">大庆</html:option>
<html:option value="哈尔滨">哈尔滨</html:option>
</html:select>
6、<html:checkbox />和<html:multibox />
<%
com.Person p = new com.Person();
pageContext.setAttribute("per",p);
%>
<html:multibox name="per" property="city" value="哈尔滨"/>哈尔滨
<html:multibox name="per" property="city" value="大庆"/>大庆
<html:multibox name="per" property="city" value="北京"/>北京
注意:<html:checkbox />无法设置默认值,可以通过<html:multibox />代替.
7、<html:textarea />
<%
com.Person p = new com.Person();
pageContext.setAttribute("per",p);
%>
<html:textarea name="per" property="name"></html:textarea>
8、<html:form />
注意:
<html:form />必须和一个具体的ActionForm绑定.它是如何找到需要绑定的那个ActionForm呢?
答案:Action------>ActionForm
9、<html:submit />和<html:reset />
对应HTML中的 submit 和 reset
分享到:
相关推荐
Struts标签- HTML标签
在Eclipse中配置Struts2项目(html)手把手教会你 如何在Eclipse中配置Struts2。 struts2 标签库介绍(html)对Struts2的标签做了详细的介绍让你轻松掌握Struts2的标签。 STRUTS2学习文档.pdf 对Struts2的一些配置...
Struts标签库html标签、logic标签、bean标签
struts中常用的html标签例子 能够快速上手struts-html标签
struts标签 • Bean Tags:该标签库包含的标签可以用来创建bean、访问bean和访问bean的属性。同时提供了依据cookies、headers和parameters的值创建相关...HTML Tags:该标签库包含的标签可以用来创建Struts输入表单。
Struts标签 大全
vs2005写的将html标签转为struts标签的工具
JSP Struts的HTML标签库详解
自已讲课用的初稿:PPT struts-html标签
struts html 标签 struts html 标签 struts html 标签 struts html 标签
<html:form> <html:form>用来创建表单,<html:form>必须包含一个action属性,否则JSP会抛出一个异常.
详细描述了常用的struts框架中的备案,html,logic标签的应用
struts标签-HTML标签笔记
1.struts标签的使用 2.struts常用html标签库 3.在STRUTS中如何使用标签
struts的htmlcheckbox标签的默认选中问题
Struts提供了五个标签库,即:HTML、Bean、Logic、Template和Nested。 HTML 标签 : 用来创建能够和Struts 框架和其他相应的HTML 标签交互的HTML 输入表单 Bean 标签: 在访问JavaBeans 及其属性,以及定义一个新...
JSP StrutsHTML标签库详解,我觉得挺好的,希望能给大家带来帮助
1.x中常用的标签只有4中html、bean、logic、tiles 而struts2.0里的标签却没有分类,只用在jsp头文件加上 <%@ taglib prefix="s" uri="/struts-tags" %> 就能使用struts2.0的标签库 下面就介绍每个标签的具体...
Struts1.x HTML标签库,好多标签用法介绍