这是jsp页面
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>客户管理</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link href="css/logistics.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" >
function gos(i){
theform.action = "testss";
theform.submit(); // 无法转到这个ACTION
}
</script>
</head>
<body>
<h2>客户管理</h2>
<fieldset>
<legend>查询条件</legend>
<form action="querys" method="post" name="theform" id="theform">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="trTitle">单位名称:</td>
<td><label for="textfield"></label>
<input type="text" name="clientName" id="textfield" value="${models.clientName}"/></td>
<td> </td>
<td class="trTitle">客户编号:</td>
<td><input type="text" name="clientId" id="textfield5" /></td>
<td> </td>
<td class="trTitle">电 话:</td>
<td><label for="textfield2"></label>
<input type="text" name="telphone" id="textfield2" /></td>
</tr>
<tr>
<td class="trTitle">客户分类:</td>
<td><label for="select"></label>
<select name="clientType" id="select">
<option value="0">托运客户</option>
<option value="1">收货客户</option>
</select></td>
<td> </td>
<td class="trTitle">联系人姓名</td>
<td><input type="text" name="linkmanName" id="textfield6" /></td>
<td> </td>
<td class="trTitle">简 拼:</td>
<td><input type="text" name="spellBJDX" id="textfield4" /></td>
</tr>
</table>
<input type="submit" name="button" id="button" value="查询" class="btn" />
</form>
<a href="#" onclick="gos()">首页</a>
</body>
</html>
STRUTS
<action name="testss" class="Tests">
<result name="success">/MyJsp.jsp</result>
</action>
Action类
@Controller("Tests")
public class Tests extends ActionSupport{
public String execute(){
System.out.println("Tests我被调用了");
return SUCCESS;
}
}
表单
------解决方案--------------------