Is there a quick search for url-to-controller mapping when using @RequestMapping?

Given a web application that makes full use of @RequestMapping to bind URLs to the controller, I was wondering if there is a way or plugin that will display web applications with a full set of URLs?

Similar to struts.xml, where you have all the urls for the action, so you can see this information in a central place?

Otherwise, what happens is given a url from the screen, I end up doing a search in the java file every time I want to find this URL controller.

+5
source share
2 answers

Eclipse Springsource Tool Suite ( ): http://www.springsource.com/developer/sts Spring , Java EE, "Spring Elements" , ( ).

edit: , STS, NetBeans Eclipse.

+8

DefaultAnnotationHandlerMapping . - :

@Autowired
// org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping
private DefaultAnnotationHandlerMapping defaultAnnotationHandlerMapping;

public void outputMappings() {
for (Map.Entry<String, Object> entry : 
    defaultAnnotationHandlerMapping.getHandlerMap().entrySet()) {
        System.out.println(entry.getKey() + "->" + 
                           entry.getValue().getClass().getName());
    }

}

. AbstractUrlHandlerMapping.getHandlerMap() DefaultAnnotationHandlerMapping

0

All Articles