<input type="hidden" name="yg.top_end_at" value="${y.top_end_at!}">
top_end_at是时间类型
在提交的时候,后台getModel的时候报以下错误,应该是类型转换的错误。
com.jfinal.plugin.activerecord.ActiveRecordException: com.jfinal.core.ModelInjectException: Can not convert parameter: yg.top_end_at
at com.jfinal.plugin.activerecord.tx.Tx.intercept(Tx.java:52)
at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:51)
at com.qikanyun.inteceper.AuthInterceptor.intercept(AuthInterceptor.java:38)
at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:51)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:75)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:365)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:937)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:998)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.jfinal.core.ModelInjectException: Can not convert parameter: yg.top_end_at
at com.jfinal.core.ModelInjector.injectActiveRecordModel(ModelInjector.java:101)
at com.jfinal.core.ModelInjector.inject(ModelInjector.java:49)
at com.jfinal.core.Controller.getModel(Controller.java:574)
at com.qikanyun.index.HomeController.save_yg(HomeController.java:233)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:55)
at com.jfinal.plugin.activerecord.tx.Tx.intercept(Tx.java:47)
... 28 more
Caused by: java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh🇲🇲ss[.fffffffff]
at java.sql.Timestamp.valueOf(Timestamp.java:194)
at com.jfinal.core.TypeConverter.convert(TypeConverter.java:92)
at com.jfinal.core.ModelInjector.injectActiveRecordModel(ModelInjector.java:97)
... 37 more
@JFinal 是不是应该加强一些对时间类型的转换处理啊
java.lang.IllegalArgumentException:Timestampformatmustbeyyyy-mm-ddhh:mm:ss[.fffffffff]
你的变量值是多少?是否是格式不对
值肯定不一样的,是类似于2013-3-157:30:30这样的和要求的格式不符合。但是我这个是隐藏字段,从数据库把时间查出来,再post回去,如果这个过程还要人为再去处理,岂不是很麻烦。读出来和接收的值不匹配,这使用起来也太不方便了。 @JFinal表单提交的数据是否与com.jfinal.core.TypeConverter.timeStampPattern 中的pattern一致?版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。