Results 1 to 2 of 2

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

Hybrid View

  1. #1
    Join Date
    Dec 2012
    Posts
    3

    Default 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 at 05:39 AM.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •