P. 1
Spring Live

Spring Live

4.71

|Views: 3,973|Likes:
Published by srmd21
Spring Live Tutorial
Spring Live Tutorial

More info:

Published by: srmd21 on Dec 26, 2007
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

06/16/2013

pdf

text

original

Spring’s MVC framework is similar to Struts in that it uses a single instance of a controller by default. You can
change your Controllers to create new instances for every request by adding singleton="false" to your
controller’s bean definition. This way, if you prefer WebWork’s “new action per request,” you can still get that
functionality.

Spring MVC has a single servlet than handles all requests, similar to most Java web frameworks. It’s called the
DispatcherServlet and is responsible for “dispatching” request to handlers, which have mappings to tell it
where to go next. To begin working with Spring MVC, first configure the MyUsers application to use the
DispatcherServlet for its front controller, rather than Struts’ ActionServlet.

If you’ve completed the Quick Start tutorial in Chapter 2, you should have no problems with the following set of
instructions. If you have not completed the Quick Start tutorial, but you’d like to do this one, download the
completed project after Chapter 2.

Spring Live

Converting Struts to Spring MVC

85

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->