日期:2014-05-16 浏览次数:20392 次
<Connector port="8080" URIEncoding="UTF-8" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
[client] port=3306 [mysql] default-character-set=utf8
&useUnicode=true&characterEncoding=utf-8
User.name = 用户名 User.pwd = 用户密码 User.description = 用户详细信息 ############################## User.submit = 登录 User.create = 注册 User.update = 提交 User.reset = 重置 User.edit = 修改注册信息 User.logout = 退出登录 User.delete = 删除用户 User.selectAll = 查询全部
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> <validators> <field name="name"> <field-validator type="requiredstring"> <message><![CDATA[ 用户名不能为空 ]]></message> </field-validator> </field> <field name="pwd"> <field-validator type="requiredstring"> <message key="requiredstring"/> </field-validator> </field> </validators>
<action name="user_*" method="{1}" class="example.UserAction"> <result name="input"> /example/user_create.jsp </result> <result name="create_success"> /example/user_create_success.jsp </result> <result name="editInit"> /example/user_edit.jsp </result> <result name="selectAll"> /example/user_selectAll.jsp </result> <result name="delete_success"> /example/user_create_success.jsp </result> <result name="create"> /example/user_create.jsp </result> </action>
public String select() throws Exception { // 查询SQL String USER_SELECT = "SELECT u.NAME, u.PWD, u.DESCRIPTION FROM USER u"; ResultSetHandler rsh = new ResultSetHandler() { public Object handle(ResultSet rs) throws SQLException { List<User> userListTemp = n