前台传入日期参数查询报异常
@JFinal 你好,想跟你请教个问题:项目使用sqlserver2008库,JFinal使用2.1版,controller 使用getModel获取数据,报如下异常,经查看代码,是一个转换类异常,Interceptor : com.jfinal.ext.interceptor.SessionInViewInterceptor.(SessionInViewInterceptor.java:1)
com.njsoft.mhis2.wechat.interceptor.AuthInterceptor.(AuthInterceptor.java:1)
Parameter : attr.statisTime=2016-01-03 attr.endTime=2016-01-03
--------------------------------------------------------------------------------
2016-01-03 22:41:32
[ERROR]-[Thread: http-apr-8080-exec-2]-[com.jfinal.core.ActionHandler.handle()]: /outpats
java.lang.RuntimeException: Can not convert parameter: attr.statisTime
at com.jfinal.core.ModelInjector.injectActiveRecordModel(ModelInjector.java:102)
at com.jfinal.core.ModelInjector.inject(ModelInjector.java:50)
at com.jfinal.core.Controller.getModel(Controller.java:654)
at com.njsoft.mhis2.wechat.controller.BaseController.getModelByAttr(BaseController.java:84)
at com.njsoft.mhis2.wechat.controller.HomeController.outpats(HomeController.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.jfinal.aop.Invocation.invoke(Invocation.java:71)
at com.njsoft.mhis2.wechat.interceptor.AuthInterceptor.intercept(AuthInterceptor.java:59)
at com.jfinal.aop.Invocation.invoke(Invocation.java:65)
at com.jfinal.ext.interceptor.SessionInViewInterceptor.intercept(SessionInViewInterceptor.java:44)
at com.jfinal.aop.Invocation.invoke(Invocation.java:65)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:74)
at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:75)
at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:47)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2522)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2511)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
自己处理一下这个数据
回复
当然是能自己处理getPara,使用getModel方便多,但这个问题的确是一个日期转换格式bug。
引用来自“腾讯公告”的评论
参数问题,格式不对
参数问题,格式不对