你可以都提交到一个ACTION里在ACTION里分
public ActionForward execute(ActionMapping mapping,ActionForm form,
HttpServletRequest request,HttpServletResponse response){
String operType=request.getParameter("operType");
if(operType.equals("buyRegist")){
return BuyRegist(mapping,form,request,response);
}else if(operType.equals("update")){
return Search(mapping,form,request,response);
}else if(operType.equals("search")){
return Search(mapping,form,request,response);
}else{
return null;
}
}
public ActionForward BuyRegist(ActionMapping mapping,
ActionForm form,HttpServletRequest request,HttpServletResponse response) {
}
public ActionForward Search(ActionMapping mapping,
ActionForm form,HttpServletRequest request,HttpServletResponse response) {
}
public ActionForward execute(ActionMapping mapping,ActionForm form,
HttpServletRequest request,HttpServletResponse response){
String operType=request.getParameter("operType");
if(operType.equals("buyRegist")){
return BuyRegist(mapping,form,request,response);
}else if(operType.equals("update")){
return Search(mapping,form,request,response);
}else if(operType.equals("search")){
return Search(mapping,form,request,response);
}else{
return null;
}
}
public ActionForward BuyRegist(ActionMapping mapping,
ActionForm form,HttpServletRequest request,HttpServletResponse response) {
}
public ActionForward Search(ActionMapping mapping,
ActionForm form,HttpServletRequest request,HttpServletResponse response) {
}
解决方案 »
- 用过ibatis和mybatis的朋友请进
- 请大家帮忙推荐几本关于ssh2的整合开发书(要求如下)
- mvn install 编译好的class为什么都是小写的?
- 帮忙看下关于replaceAll()方法的问题
- 【共享】ibatis在debug时打印完整的SQL语句
- 有没有人用jsf
- struts中<html:file>标签
- 请求请求一个struct2的action 在跳转后的页面的url中已接受到上页面传的参数 为什么在跳转后的页面中 取不到这些参数呢
- 用了<jsp:include></jsp:include>标签时发生异常,各位请帮忙看看!
- 谁能帮我看看怎么做个问题?在Jbuilder9运行
- bean标签的问题
- JMS问题,我无从下手了
<%@ page language="java" contentType="text/html; charset=gb2312"%>
<jsp:useBean id="re" scope="page" class="bank.registManagebean"/>
<jsp:setProperty name="re" property="txtname" param="txtname"/>
<jsp:setProperty name="re" property="txtpass" param="txtpass"/>
<jsp:setProperty name="re" property="txtrepass" param="txtrepass"/>
<jsp:setProperty name="re" property="txtadress" param="txtadress"/>
<jsp:setProperty name="re" property="txtphone" param="txtphone"/>
<jsp:setProperty name="re" property="txtemail" param="txtemail"/>
<html>
<head>
<title>注册信息管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
String judge=request.getParameter("flag");
if (judge=="query")
{
out.println(judge);
}
if(judge=="insert")
{
//新增
boolean validate=re.loadValidate();
if(validate==true)
{
String str1=new String("");
str1=request.getParameter("txtname");
int i=re.insertregist();
//int userid=re.insertregist();
if(i!=0)
{
//HttpSession ses=request.getSession(true);
session.setAttribute("b1",str1);
out.println(session.getAttribute("b1"));
//out.println(txtname+",");
%>
<p><font color="#FF0000" face="黑体">恭喜!您已经添加成功,</font></p><br>
<a href=""></a>
<%
}
else
{
out.println(str1+",");
%>
<p><font color="#FF0000" face="黑体">您在添加记录时发生错误</font></p>
<%
}
}
else
{
out.println("已有此用户名,请另起用户名!");
%>
<a href=""></a>
<%
}
}
%>