Announcement Announcement Module
Collapse
No announcement yet.
No adapter for handler [ControllerPack.ContactController@588a588a] Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No adapter for handler [ControllerPack.ContactController@588a588a]

    I have used both <mvc:annotation-driven /> and SimpleControllerHandlerAdapter but still facing the issue.



    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-3.0.xsd
    http://www.springframework.org/schema/mvc http://www.springframework.org/schem...ng-mvc-3.0.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:component-scan
    base-package="ControllerPack" />

    <mvc:annotation-driven />

    <bean class="org.springframework.web.servlet.mvc.SimpleC ontrollerHandlerAdapter"/>

    <!-- <bean id="viewResolver"
    class="org.springframework.web.servlet.view.UrlBas edViewResolver">
    <property name="viewClass"
    value="org.springframework.web.servlet.view.JstlVi ew" />
    <property name="prefix" value="/WEB-INF/jsp/" />
    <property name="suffix" value=".jsp" />
    </bean>
    -->

    <bean id="ContactController" autowire="byName"
    class="ControllerPack.ContactController">

    </bean>



    <bean id="urlMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
    <property name="mappings">
    <map>
    <entry key="/contacts.html"><ref bean="ContactController"/></entry>
    <entry key="/addContact.html"><ref bean="ContactController"/></entry>
    </map>
    </property></bean>
    </beans>
    Last edited by faraz; Jan 5th, 2013, 06:39 AM.

  • #2
    Please use [ code][/code ] tags when posting code that way it remains readable ...

    Post your controller... Also make sure that it is either a Controller or @Controller not both... Also specifying a HandlerAdapter overrides the defaults and disables @Controller parsing, next to that it is registered by default so you don't need to explicitly define it.

    Comment

    Working...
    X