Announcement Announcement Module
Collapse
No announcement yet.
Creating a Custom handlermapper, What handlermapping does spring mvc use? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating a Custom handlermapper, What handlermapping does spring mvc use?

    In my spring mvc application, I am using annotations on the controllers.

    What handlermapping implementation will map my urls to controller methods then? (I use requestmapping("/home")

    As a simple test to learn how to make my own handlermapper, how could I create a handler mapper that would do the following:

    If a request comes in for the url "/myblog", I want to run the method in BlogController#index.

    How would I do this?

    Note: The goal for me is to learn how to create a handler mapper that will work dynamically (reading values from the db), so I can't hard code urls to controllers.

  • #2
    Depends on the spring version. 3.1 uses the RequestMappingHandlerMapping < 3.1 use DefaultAnnotationHandlerMapping... This is all explained in the reference guide so I suggest a read of that.

    Regarding database driven mapping information use the forum search as that has been asked before.

    Comment


    • #3
      Originally posted by Marten Deinum View Post
      Depends on the spring version. 3.1 uses the RequestMappingHandlerMapping < 3.1 use DefaultAnnotationHandlerMapping... This is all explained in the reference guide so I suggest a read of that.

      Regarding database driven mapping information use the forum search as that has been asked before.
      I did find a post where you were involved, but I'm nto sure if it was 3.1 or not.

      I'll try and find it again.

      Comment


      • #4
        Marten, do you know where that post is?

        Comment

        Working...
        X