Announcement Announcement Module
Collapse
No announcement yet.
AnnotationMethodHandlerAdapter order property triggers Ajax REST DELETE malfunction Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • AnnotationMethodHandlerAdapter order property triggers Ajax REST DELETE malfunction

    I've been struggling with this for a few days now and this is where I isolated the problem:
    Here is my spring config:
    PHP Code:
    <bean id="jacksonDateMapper" class="com.objectverse.system.config.DateMapper">
            <
    property name="mask" value="yyyy-MM-dd HH:mm:ss" />
        </
    bean>

        <
    bean id="jsonHttpMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
            <
    property name="objectMapper" ref="jacksonDateMapper" />
        </
    bean>
        
        <
    bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>
         <
    bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
              <
    property name="order" value="1" />
              <
    property name="messageConverters">
                <list>
                      <
    ref bean="jsonHttpMessageConverter"/>
                </list>
              </
    property>
          </
    bean
    I'm using custom jacksonDateMapper. If I put
    PHP Code:
    <property name="order" value="1" /> 
    line in upper configuration jsonHttpMessageConverter is used. It doesn't matter if the order is 1 or 10. If the order property is used my REST DELETE request does not work. If I delete the order property the REST DELETE request is working but jsonHttpMessageConverter is not used. It doesn't help even if I add order property to other beans.

    Is there anything I have wrong here in this configuration?
    Thanks in advance for any hints.

    Bojan
    Last edited by bkraut; Nov 25th, 2011, 04:34 AM.

  • #2
    Ok. I managed to solve this. Here is the solution. I have to register additional converter:

    PHP Code:

    <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
              <
    property name="order" value="0" />
              <
    property name="messageConverters">
                <list>
                      <
    ref bean="jsonHttpMessageConverter"/>
                      <
    ref bean="stringHttpMessageConverter"/>
                </list>
              </
    property>
          </
    bean>
          
          <
    bean id="stringHttpMessageConverter" 
           
    class="org.springframework.http.converter.StringHttpMessageConverter"/> 
    Now it handles also all REST functions.

    Comment

    Working...
    X