spring annotation not working

前端 未结 6 462
你的背包
你的背包 2020-12-11 13:54

I am starting with Spring Framework and want to do a HelloWorld with annotatios, I\'ve made it work creating a controller and a view, basic hello work I guess; however, I wa

相关标签:
6条回答
  • 2020-12-11 14:10

    <mvc:annotation-driven/> will solve out your problem.

    0 讨论(0)
  • 2020-12-11 14:10

    in your disapatcher-servlet.xml, add <mvc:annotation-driven/> to enable annotation driven handler mapping.

    0 讨论(0)
  • 2020-12-11 14:11

    Please try this

    <bean 
    class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/> 
    

    add an entry in dispatcher-servlet.xml

    0 讨论(0)
  • 2020-12-11 14:12

    You mapped the path /index.do in your controller, so you have to access it with the following url: http://localhost/av/index.do

    0 讨论(0)
  • 2020-12-11 14:20

    You are missing

    <mvc:annotation-driven />
    

    in your config dispatcher-servlet.xml

    See here for more info

    0 讨论(0)
  • 2020-12-11 14:22

    Try to go through one of my tutorials:

    Creation of a simple Controller with java-based config

    I hope I will get success with it

    0 讨论(0)
提交回复
热议问题