javax.el.ELException: Cannot convert 2015-12-03 18:50 of type class java.lang.String to class java.u

x Dismiss
Join the Stack Overflow Community
Stack Overflow is a community of 7.0 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

javax.el.ELException: Cannot convert 2015-12-03 18:50 of type class java.lang.String to class java.util.Date?

Ask Question
up vote 2 down vote favorite

When I use the El expression to the value of the time can be normal, but the time of the format has been a problem,

Here is my code and the error exception



   javax.el.ELException: Cannot convert 2015-12-03 18:50 of type class java.lang.String to class java.util.Date
    org.apache.el.lang.ELSupport.coerceToType(ELSupport.java:419)
    org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
    org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:944)
    org.apache.jsp.pages.activityList_jsp._jspx_meth_fmt_005fformatDate_005f0(activityList_jsp.java:385)
    org.apache.jsp.pages.activityList_jsp._jspx_meth_c_005fforEach_005f0(activityList_jsp.java:348)
    org.apache.jsp.pages.activityList_jsp._jspx_meth_c_005fif_005f0(activityList_jsp.java:291)
    org.apache.jsp.pages.activityList_jsp._jspService(activityList_jsp.java:181)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:168)
    org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
    org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1228)
    org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1011)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:955)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
share
 
 

1 Answer 1

active oldest votes
up vote 4 down vote accepted

active.expire_time variable is a String and it is already formatted.

However fmt:formatDate expects variable of Date type.

Or you can convert active.expire_time to date and show it:



share
 
 

Your Answer

 
draft saved
draft discarded

Post as a guest

Name
Email
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged java jsp date format el or ask your own question.


lang-java

你可能感兴趣的:(A1000-JSP相关)