Struts2 form表单常用标签学习笔记
2008-06-01 22:05
<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%> <html> <head> </head> <body> <s:form action="login.action" method="post" name="student" enctype="multipart/form-data"> <s:textfield label="姓名" name="student.username" tooltip="Enter your Name here" /> <s:textfield label="密码" name="student.password" tooltip="Enter your password here" /> <s:textarea tooltip="Enter your remart" label="备注" name="remart" cols="20" rows="3" /> <!-- 在value中设置默认选中哪个项 --> <s:select tooltip="Choose user_type" label="用户类型" list="#{'dayi':'大一','daer':'大二'}" value="#{'dayi':'大一'}" name="student.user_type" emptyOption="false" headerKey="None" headerValue="None" /> <s:checkboxlist tooltip="Choose your Friends" label="朋友" list="{'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}" value="{'Patrick','Jason'}" name="friends" /> <s:doubleselect tooltip="Choose Your State" label="State" name="region" list="{'North', 'South'}" value="'North'" doubleValue="'Florida'" doubleList="top == 'North' ? {'Oregon', 'Washington'} : {'Texas', 'Florida'}" doubleName="state" headerKey="-1" headerValue="---------- Please Select ----------" emptyOption="true" /> <s:checkbox tooltip="Confirmed that your are Over 18" label="年龄" name="legalAge" value="18" /> <!-- 上传附件 --> <s:file tooltip="Upload Your Picture" label="Picture" name="picture" /> <s:submit /> </s:form> </body> </html> |