Announcement Announcement Module
No announcement yet.
Request Maps Don't Come With ConnectController & ProviderSigninController Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Request Maps Don't Come With ConnectController & ProviderSigninController

    In my app log files, I can see the connectController and providerSignInController on a line of Pre-instantiating singletons in istableBeanFactory, but their request maps (/connect/{providerId}, /signin/{providerId} etc.) do not show in RequestMappingHandlerMapping. I use the Java-based configurations as shown in the social showcase sample.

    What is missing?
    Last edited by vw729; Mar 12th, 2012, 05:09 PM.

  • #2
    Are you enabling annotation-based Spring MVC? In XML it would be done with:

    Or in Java-based configuration (Spring 3.1.x-only):

    public class MyConfiguration { ... }


    • #3
      I add a Spring Social function into an exiting project, which already has annotation-based enabled, originally built with the 3.0 version. This case remains me the same problem for my own controller classes which don't have @Controller, but with @RequestMapping. Some additional configuration is needed for 3.1, I guess.
      Last edited by vw729; Mar 12th, 2012, 05:08 PM.


      • #4
        Annotation-based MVC is no different in Spring 3.1 than in Spring 3.0, other than you have the option of using @EnableWebMvc in Spring 3.1 (it wasn't there in Spring 3.0). As long as you have that in your Java-bases configuration *or* have <mvc:annotation-driven/> in your XML, then it should enable the mappings via @RequestMapping.

        Are you saying that annotation-based MVC is enabled, but the controllers still aren't working?


        • #5
          Correct, my log files show the two controllers are instanced, but no sight of those URLs. Since I already have a XML configuration in place, I add Java-based configuration class with the annotation and a context:component-scan for the class path. And yes, there is <context:annotation-config /> and <mvc:annotation-driven>. And URLs defined @requestMapping along with @Controller show, but not for those without @Controller for my controllers. I assume that is the same for the two controllers. My project is built up from the STS Spring MVC project template. The social beans are configured in the same fashion as the showcase. The @Configuration, however, is setup as a regular annotation configuration with a component scan path. That shall not make any difference, I assume.
          Last edited by vw729; Mar 12th, 2012, 09:52 PM.