Announcement Announcement Module
Collapse
No announcement yet.
jsp/usebean and propertyeditors Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • jsp/usebean and propertyeditors

    I have a application that is using spring MVC, however on a page I am using fairly standard JSP/javabeans and not the spring:bind syntax. This is working fine and the command object's properties are set ok using jsp:setproperty. The validation class is also being called by the spring framework however I am trying to set a java.util.Date property and so have used the following
    Code:
     <bean id="customEditorConfigurer"
            class="org.springframework.beans.factory.config.CustomEditorConfigurer">
        <property name="customEditors">
          <map>
    
            <entry key="java.util.Date">
              <bean class="org.springframework.beans.propertyeditors.CustomDateEditor">
                <constructor-arg index="0">
                  <bean class="java.text.SimpleDateFormat">
                    <constructor-arg><value>d/M/yy</value></constructor-arg>
                  </bean>
                </constructor-arg>
                <constructor-arg index="1"><value>true</value></constructor-arg>
              </bean>
            </entry>
            
          </map>
        </property>
      </bean>
    This doesn't appear to work and I am still getting the same exception:

    Code:
    org.apache.jasper.JasperException: jsp.error.beans.property.conversion
    	org.apache.jasper.runtime.JspRuntimeLibrary.internalIntrospecthelper(JspRuntimeLibrary.java:359)
    	org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(JspRuntimeLibrary.java:306)
    	org.apache.jasper.runtime.JspRuntimeLibrary.introspect(JspRuntimeLibrary.java:284)
    	org.apache.jsp.WEB_002dINF.jsp.advancedsearch_jsp._jspService(org.apache.jsp.WEB_002dINF.jsp.advancedsearch_jsp:90)
    	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    	org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:97)
    	org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
    	org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:928)
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:705)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
    	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:347)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    I thought this could be because the bean is not being managed by spring, but if this was the case I would expect the validation and controller to not be able to access it either.

    Can anyone point me in the right direction? Thanks.
Working...
X