在线等---急
这是一个jsp。
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<html>
<head>
<title>My JSP 'search.jsp' starting page</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">
</head>
<script type="text/javascript" src="city.js"></script>
<body onload="Province();">
<form action="search.do" name="Frame" mathod="post">
<select id="province" onchange="City();"></select><select id="city" onchange="Area();"></select><select id="area"></select>
<select id="ps" onchange="Cs();"></select><select id="cs" onchange="As();"></select><select id="as"></select>
<br>
<input type="submit" name="submit" value="搜索">
</form>
</body>
</html>
提交的.do
package com.search.struts.action;
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 com.search.struts.form.SearchForm;
public class SearchAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
SearchForm searchForm = (SearchForm) form;// TODO Auto-generated method stub
HttpSession session=request.getSession();
String province=null;
String city=null;
String area=null;
String ps=null;
String cs=null;
String as=null;
province=request.getParameter("province");
city=request.getParameter("city");
area=request.getParameter("area");
ps=request.getParameter("ps");
cs=request.getParameter("cs");
as=request.getParameter("as");
System.out.print("省份"+province);
return mapping.findForward("ok");
}
}
Struts-config.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<data-sources />
<form-beans >
<form-bean name="searchForm" type="com.search.struts.form.SearchForm" />
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="searchForm"
input="/search.jsp"
name="searchForm"
path="/search"
scope="request"
type="com.search.struts.action.SearchAction" >
<forward name="ok" path="/ok.jsp"></forward>
<forward name="fail" path="/fail.jsp"></forward>
</action>
</action-mappings>
<message-resources parameter="com.yourcompany.struts.ApplicationResources" />
</struts-config>
我在.do中输出province值为什么是空的呢?请帮忙看看一下