Results 1 to 4 of 4

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

  1. #1

    Default 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. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    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.
    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

  3. #3

    Default

    Quote 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.

  4. #4

    Default

    Marten, do you know where that post is?

Tags for this Thread

Posting Permissions

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