html
<s:form action="adduser" >
<table>
<tr>
<td>
<input name="lg.userName" >
<input name="lg.userPass">
<input type="submit" value="提交">
</td>
</tr>
</table>
</s:form>
<table>
<tr>
<td>
<input name="lg.userName" >
<input name="lg.userPass">
<input type="submit" value="提交">
</td>
</tr>
</table>
</s:form>
package manage.personal.action;
import htcommoninfo.Database;
import com.opensymphony.xwork2.ActionSupport;
import manage.personal.bean.LoginBean;
public class AddUserAction extends ActionSupport{
/**
*
*/
private static final long serialVersionUID = 1L;
private LoginBean lg;
public LoginBean getLg()
{
return lg;
}
public void setLg(LoginBean lg)
{
this.lg = lg;
}
public String execute(){
String sql="insert LoginTable(User_Name,User_Pass,User_Remark) values ('"+lg.getUserName()+"'"
+",'"+lg.getUserPass()+"','"+"test"+"')";
Database db=Database.getInstance();
db.execute(sql);
String temp=lg.getUserName();
return "success";
}
import htcommoninfo.Database;
import com.opensymphony.xwork2.ActionSupport;
import manage.personal.bean.LoginBean;
public class AddUserAction extends ActionSupport{
/**
*
*/
private static final long serialVersionUID = 1L;
private LoginBean lg;
public LoginBean getLg()
{
return lg;
}
public void setLg(LoginBean lg)
{
this.lg = lg;
}
public String execute(){
String sql="insert LoginTable(User_Name,User_Pass,User_Remark) values ('"+lg.getUserName()+"'"
+",'"+lg.getUserPass()+"','"+"test"+"')";
Database db=Database.getInstance();
db.execute(sql);
String temp=lg.getUserName();
return "success";
}