Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
3Activity
0 of .
Results for:
No results containing your search query
P. 1
Simple Controller using Spring MVC

Simple Controller using Spring MVC

Ratings:

4.6

(5)
|Views: 2,692 |Likes:
Published by Santosh Kothapalli
Using basic Spring Controller
Using basic Spring Controller

More info:

Published by: Santosh Kothapalli on Feb 18, 2009
Copyright:Attribution Non-commercial

Availability:

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

06/18/2013

 
Writing a Simple Controller using Spring MVC
Description: Display the view on the browser that is configured. I have made anattempt to write a basic controller of spring.Things to be done to attain the above objective are as followsStep 1: Configuration of DispatcherServlet of Spring in the web.xmlAll the requests in spring are handled by RequestDispatcher, if the name of the servletis demo then we need to have a spring configuration file with the namedemo-servlet.xml in the WEB-INF directory
 
Step 2: Assume that if all our requests have to pass through spring controller beforethe view is rendered. The Controller should be as belowThe controller will return ModelAndView Object, where the name of the view is
index.
 
Step 3: We need to configure this controller in the spring configuration filei.e. demo-servlet.xml, the spring container loads the controller through IOCIn Spring MVC we are required to configure the following1.Controller – Similar to servlet in J2EE2.Handler Mapping – It is the mapping of the URL to the specific Controller 3.View Resolver – the suffix for the view that is returned by the Controller i.e.index in Step 2 which will be index.jsp. viewClass is the madatory attribute.Step 4: Prepare the view index.jsp 

Activity (3)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Fernando Lopez liked this

You're Reading a Free Preview

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