哥哥姐姐们我的查询需要根据开始时间和结束时间来查询,我不会写啊,不知道咋办了
jsp
<table width="400" height="150">
<tr>
<td>开始日期</td>
<td><input type="text" style="width: 70px"
onfocus="HS_setDate(this)"></td>
</tr>
<tr>
<td>结束日期</td>
<td><input type="text" style="width: 70px"
onfocus="HS_setDate(this)"></td>
</tr>
<tr>
<td><a href='<s:url action="search"/>'>查询</a></td>
</tr>
</table>
<table align="center" width="70%" border="1" bordercolor="black">
<tr>
<td width="10%" align="center">日期时间</td>
<td width="8%" align="center">操作员</td>
<td width="15%" align="center">IP地址</td>
<td width="10%" align="center">模块</td>
<td width="15%" align="center">动作</td>
<td width="20%" align="center">结果</td>
<td width="22%" align="center">备注信息</td>
</tr>
<s:iterator value="logs">
<tr>
<td><s:property value="datetime" /></td>
<td><s:property value="operatorId" /></td>
<td><s:property value="clientIp" /></td>
<td><s:property value="moduleName" /></td>
<td><s:property value="action" /></td>
<td><s:property value="status" /></td>
<td><s:property value="message" /></td>
</tr>
</s:iterator>
</table>
jsp这样写行么?action里该怎么做啊
jsp
<table width="400" height="150">
<tr>
<td>开始日期</td>
<td><input type="text" style="width: 70px"
onfocus="HS_setDate(this)"></td>
</tr>
<tr>
<td>结束日期</td>
<td><input type="text" style="width: 70px"
onfocus="HS_setDate(this)"></td>
</tr>
<tr>
<td><a href='<s:url action="search"/>'>查询</a></td>
</tr>
</table>
<table align="center" width="70%" border="1" bordercolor="black">
<tr>
<td width="10%" align="center">日期时间</td>
<td width="8%" align="center">操作员</td>
<td width="15%" align="center">IP地址</td>
<td width="10%" align="center">模块</td>
<td width="15%" align="center">动作</td>
<td width="20%" align="center">结果</td>
<td width="22%" align="center">备注信息</td>
</tr>
<s:iterator value="logs">
<tr>
<td><s:property value="datetime" /></td>
<td><s:property value="operatorId" /></td>
<td><s:property value="clientIp" /></td>
<td><s:property value="moduleName" /></td>
<td><s:property value="action" /></td>
<td><s:property value="status" /></td>
<td><s:property value="message" /></td>
</tr>
</s:iterator>
</table>
jsp这样写行么?action里该怎么做啊
解决方案 »
- 在web上写入信息到Mysql服务器
- 求助Eclipse下使用IReport和JasperReports的WEB报表解决方法?
- 问问大家有没有人用frontpage做JSP的?
- 求助:MYSQL中distinct的使用方法
- 自定义一个taglib,在taghandler中有创建对象行为,按F5不断刷新页面,导致内存不足。详见文章内容!
- 使用Jquery实现了可拖动的DIV后,怎么保存改变后的结果
- 请问以“?”形式传递的参数中如果参数值中有“%”怎么处理??
- html:text求助
- 从cvs checkout下来的java项目如何用tomcat运行
- 求这样的时间代码(附代码)
- ExtJs 添加控件
- 想问下java.util.zip是压缩客户端的文件夹还是服务器端的
我在action里调用,可是不行啊,我就调接口里的findSystemLogs(a,b);里面的两个参数是开始时间和结束时间
<table width="400" height="150">
<tr>
<td>开始日期 </td>
<td> <input type="text" style="width: 70px" name="sDate"
onfocus="HS_setDate(this)"> </td>
</tr>
<tr>
<td>结束日期 </td>
<td> <input type="text" style="width: 70px" name="eDate"
onfocus="HS_setDate(this)"> </td>
</tr>
<tr>
<td> <a href=' <s:url action="search"/>'>查询 </a> </td>
</tr>
</table>
后台用:
String sDate=request.getParameter("sDate");
String eDate=request.getParameter("eDate");
<table width="400" height="150">
<tr>
<td>开始日期</td>
<td><input type="text" style="width:70px" name="starttime" onfocus="HS_setDate(this)"></td>
</tr>
<tr>
<td>结束日期</td>
<td><input type="text" style="width:70px" name="endtime" onfocus="HS_setDate(this)"></td>
</tr>
<tr>
<td><a href='javascript:void(0)' onClick="time('${starttime}')">查询</a></td>
</tr>
</table>
<table align="center" width="70%" border="1" bordercolor="black">
<tr>后台这样写的
public String search()throws Exception{
String st = request.getParameter("starttime");
String et = request.getParameter("endtime");
System.out.println(st);
System.out.println(et);
if(st != null && et != null){打印的都是 null 啊
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>首页</title>
<sx:head />
</head>
<body>
<s:form action="findAllChild" namespace="/child">
<sx:datetimepicker name="starttime"/>
<sx:datetimepicker name="endtime"/>
<s:submit value="submit" />
</s:form> Query query= session.createQuery("from tableName where stime between ? and ? ");
query.setDate(0, starttime);
query.setDate(1, endtime);
需要引入包struts2-dojo-plugin-2.1.6.jar具体的datetimepicker 使用方法可以看struts2带的showcase/web/tag/ui/timepicker