页面传值不通过,请求帮助!
servlet总是获取不到页面的值,本来之前是一个JS控件,为了测试直接改为<INPUT>,可这样取到的还是都为空值,搞不明白
我是想取得页面的值传到数据库,如果取到的值为空,就会报无法将STRING转换为DATATIME,数据库传这种类型字符串“yyyy-MM-dd”是可以正确查询数据的
谢谢帮忙!
这是提交的页面,是没有问题的
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<!--
<link rel="stylesheet" type="text/css" href="styles.css"> -->
<script language="javascript" type="text/javascript" src="My97DatePicker/WdatePicker.js">
</script>
</head>
<body>
<form name="frmfee" action="./servlet/QueryServlet" method="post">
<table width="100%" border="0" align="center">
<!--DWLayoutTable-->
<tr>
<td width="80%" align="center" valign="center">增值服务收费统计系统</td>
</tr>
<tr><td><hr/></td></tr>
<tr>
<td valign="center">查看项目:
<select name="select">
<option selected>生肖姻缘</option>
<option>星座姻缘</option>
<option>血型姻缘</option>
</select></td>
</tr>
<!-- <tr>
<td>查询日期:<input class="Wdate" type="text" name="starttime" id="d15" onFocus="WdatePicker({isShowClear:false,readOnly:true})"/>到<input class="Wdate" type="text" name="endtime" id="d15" onFocus="WdatePicker({isShowClear:false,readOnly:true})"/></td>
</tr> -->
<tr>
<td>查询日期:<input type="text" name="starttime" value=""/>到<input type="text" name="endtime" value=""/></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="提交"/></td>
</tr>
</table>
</form>
</body>
</html>
这是上面页面提交的SERVLET
package iwit.sp.servlet;
import iwit.sp.query.Yinyuandao;
import
java.io.IOException;
import java.io.PrintWriter;
import
java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.jms.Session;
import javax.servlet.Servlet;
import
javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class QueryServlet extends HttpServlet implements Servlet {
/**
* Constructor of the object.
*/
public QueryServlet() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*