jsp页面:
<%@ page language="java" contentType="text/html;charset=gbk"%>
<%@include file="/taglibs.jsp" %>
<%
String id=request.getParameter("id");
String password=request.getParameter("password");
String realName=request.getParameter("realName");
String mark=request.getParameter("mark");
if(id==null || password==null||realName==null || mark==null)
return;
realName=new String(realName.getBytes("iso-8859-1"),"gbk");
mark=new String(mark.getBytes("iso-8859-1"),"gbk");
out.println(id);
out.println(password);
out.println(realName);
out.println(mark);
%>
<html:form action="bMainChange.do">
<table border=1 >
<tr>
<td>帐号:</td>
<html:hidden property="id"/>
<td width=300><html:text property="name"/></td>
</tr>
<tr>
<td>密码:</td>
<td width=300><html:text property="password" /></td>
</tr>
<tr>
<td>真实姓名:</td>
<td width=300><html:text property="realName" value="id"/></td>
</tr>
<tr>
<td>管理员类型:</td>
<td width=300>一般管理员</td>
</tr>
<tr>
<td><html:submit value="修改" /></td>
<td width=300><html:reset value="重置"/></td>
</tr>
<tr>
<td><a href="javascript:history.back();">返回</a></td>
</tr>
</table>
</html:form>
====================================================================
action:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.yourcompany.struts.action;
import hibernate.HibernateSessionFactory;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;