Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Spring MVC, is there a way to generate a list of recognized Controllers and Views?

Tags:

spring-mvc

In annotation-driven Spring MVC, is there a way to generate a table of URL patterns, verbs, and their mappings? Something like:

 /foo/{fooId}       | GET | FooController.get()     | jsp/foo/home.jsp      |  /foo/{fooId}/bars/ | GET | FooController.getBars() | jsp/foo/bar/index.jsp |  
like image 694
Larry OBrien Avatar asked Mar 10 '11 01:03

Larry OBrien


People also ask

What is true about @RequestMapping annotation in Spring MVC?

The @RequestMapping annotation can be applied to class-level and/or method-level in a controller. The class-level annotation maps a specific request path or pattern onto a controller. You can then apply additional method-level annotations to make mappings more specific to handler methods.

What is view resolver in Spring MVC?

The ViewResolver provides a mapping between view names and actual views. The View interface addresses the preparation of the request and hands the request over to one of the view technologies.

Is Spring MVC still used?

@PanadolChong accomodate Spring MVC is still used in some legacy applications, and Spring boot does majority of the configurations under-hood so to have a better understanding of how things work internally, Spring MVC might help.


1 Answers

this has helped me. inside log4j.xml put the following:

<!-- Appenders --> <appender name="console" class="org.apache.log4j.ConsoleAppender">     <param name="Target" value="System.out" />     <layout class="org.apache.log4j.PatternLayout">         <param name="ConversionPattern" value="%-5p: %c - %m%n" />     </layout> </appender>   <!-- 3rdparty Loggers --> <logger name="org.springframework.core">     <level value="info" /> </logger>  <logger name="org.springframework.beans">     <level value="info" /> </logger>  <logger name="org.springframework.context">     <level value="info" /> </logger>  <logger name="org.springframework.http">     <level value="debug" /> </logger>     <!-- below alternate between debug and info --> <logger name="org.springframework.web">     <level value="debug" /> </logger> 
like image 76
john fuhr Avatar answered Sep 30 '22 16:09

john fuhr