Announcement Announcement Module
Collapse
No announcement yet.
Annotations + SimpleURLHandlerMapping in same application Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Annotations + SimpleURLHandlerMapping in same application

    My application has been running using SimpleURLHandlerMapping since months and now I am trying to convert it to annotation based controller one by one. I am triying to run the application with both of them running together till i convert all into annotations.

    Following is my servlet.xml
    <?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="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-2.5.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">

    <context:component-scan base-package="com.he.sbo.controller"/>

    <bean id="urlMapping"
    class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
    <property name="mappings">
    <map>
    <entry key="/*/login.do">
    <ref bean="loginController" />
    </entry>
    <bean>
    <bean class="org.springframework.web.servlet.mvc.annotat ion.DefaultAnnotationHandlerMapping">
    </bean>

    After adding the bean for Annotation handler I am not able to use my simple formHandler and receiving the following error
    javax.servlet.ServletException: No adapter for handler [[email protected]]: Does your handler implement a supported interface like Controller?
    org.springframework.web.servlet.DispatcherServlet. getHandlerAdapter(DispatcherServlet.java:1091)
    org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:874)
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:809)
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:571)
    org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:511)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)


    Please help me out
Working...
X