这是我的JSP代码:<form action="baocunshijian" method="post">
<tr>
<td><input type="checkbox" value="<%=user.getUsernumberid()%>" name="box1" /></td>
<td><%=user.getUsernumber() %></td>
<td><%=user.getName() %></td>
<td><input type="text" value="<%=user.getDatetime() %>" name="riqi" /></td>
<td><input type="text" value="<%=user.getGotime() %>" name="riqi1" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'HH:mm:ss'})" class="Wdate" /></td>
<td><input type="text" value="<%=user.getOuttime() %>" name="riqi2" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'HH:mm:ss'})" class="Wdate" /></td>
<td><input type="text" value="<%=user.getOpentime() %>" name="riqi3" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'HH:mm:ss'})" class="Wdate" /></td>
</tr>
这是Action的代码:User user = new User();
baocunUsertime update = new baocunUsertime();
Boolean isSuccessed = false;
HttpServletRequest request = ServletActionContext.getRequest();
String a = request.getParameter("box1");
System.out.println(a);
user.setUsernumberid(Integer.parseInt(a));
user.setDatetime(new String(request.getParameter("riqi")));
user.setGotime(new String(request.getParameter("riqi1")));
user.setOuttime(new String(request.getParameter("riqi2")));
user.setOpentime(new String(request.getParameter("riqi3")));
这是取值的打印结果:
2015-08-28
null
null
15:40:11
------解决思路----------------------
你要看看user.getGotime() 这个是否有值,也许user对象的这个属性的值本身就是null
------解决思路----------------------
你先在页面上sysyem 输出一下看看有值没,
------解决思路----------------------
同意1楼,打断点测试下,很快能解决