| Author |
spring mvc: defining controller through @controller
|
Manuj Roy
Greenhorn
Joined: Feb 17, 2011
Posts: 7
|
|
Hi,
Can somebody help on understanding, that whether by declaring own constructor through DefaultAnnotationHandlerMapping uses some implementation of Controller interface or not. if not then how does model data is nd put in the HttpSession automatically?
Regards,
Manuj
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14468
|
|
|
Moving this question to the Spring forum.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
Bill Gorder
Bartender
Joined: Mar 07, 2010
Posts: 1282
|
|
|
On newer versions of Spring the RequestMappingHandlerMapping is used not the one you mentioned. The @Controller annotation is just a marker interface used to allow the class to be found and registered by the RequestMappingHandlerMapping, its an empty interface there is no implementation. The second part of your question has nothing to do with the first part. When the DiispatcherServlet is near through handling the request one of the last steps is for the resolved view to render the response. At this point the view that was resolved will expose the model as request attributes not put them on the session. The exception here is if you used the @SessionAttributes annotation on your controller.
|
[How To Ask Questions][Read before you PM me]
|
 |
Himanshu bisht bebo
Greenhorn
Joined: Jun 12, 2012
Posts: 9
|
|
|
The @ controller interface make simple java class act as controller .The @requestmaping specify the url to which this controller is run and all the data in request bind to this class .To bind data in to response use model object
|
 |
 |
|
|
subject: spring mvc: defining controller through @controller
|
|
|