62,610
社区成员
发帖
与我相关
我的任务
分享
<body>
<span style="font-size: 100px;color: red;font-weight: bold;">Struts2 DMI Test</span><br/>
<form action="login.action">
<input type="text" name="username" ><br>
<input type="password" name="password" ><br>
<input type="submit" value="提交" ><br>
<input type="button" value="查询" onclick="location.href='testone!query.action'" >
<input type="button" value="添加" onclick="location.href='testone!add.action'" >
<input type="button" value="删除" onclick="location.href='testone!delete.action'" >
<input type="button" value="修改" onclick="location.href='testone!update.action'" >
</form>
</body>
<package name="my01" namespace="/" extends="struts-default">
<action name="testone" class="com.fit.action.TestAction" method="execute">
<result name="success">/result01.jsp</result>
</action>
</package>
public class TestAction extends ActionSupport{
public String query(){
System.out.println("This is query method!");
return "success";
}
public String add(){
System.out.println("This is add method!");
return "success";
}
public String delete(){
System.out.println("This is delete method!");
return "success";
}
public String update(){
System.out.println("This is update method!");
return "success";
}
}
姓名 | <input id="user" name="user" type="text" /></td> |
密码 | <input id="psw" name="psw" type="text" /></td> |
<input type="submit" value="提交"/><input type="button" value="返回" /> |