Spring MVC hello world example
You may interest at this Spring 3 MVC hello world example.
In Spring MVC web application, it consist of 3 standard MVC (Model, Views, Controllers) components :
- Models – Domain objects that are processed by service layer (business logic) or persistent layer (database operation).
- Views – Usually JSP page written with Java Standard Tag Library (JSTL).
- Controllers – Interact with service layer for business processing and return a Model.
See following figures 1.1, 1.2 to demonstrate how Spring MVC web application handle a web request.
Figure 1.1 – Image copied from Spring MVC reference with slightly modification.

Figure 1.2 – P.S Image copied from book : Spring Recipes

In Spring MVC , the core disatcher component is the “DispatcherServlet“, which act as the front-controller (design pattern). Every web request have to go through this “DispatcherServlet“, and the “DispatcherServlet” will dispatches the web request to suitable handlers.
Spring MVC Tutorial
In this tutorial, you will create a simple Spring MVC hello world web application in order to understand the basic concepts and configurations of this framework.
Technologies used in this tutorial.
- Spring 2.5.6
- JDK 1.6
- Eclipse 3.6
- Maven 3
1. Directory Structure
Final directory structure of this tutorial.

2. Dependency library
Spring MVC required two core dependency libraries, spring-version.jar and spring-mvc-version.jar. If you are using JSP page with jstl, include the jstl.jar and standard.jar as well.
File : pom.xml
<!-- Spring framework --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>2.5.6</version> </dependency> <!-- Spring MVC framework --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>2.5.6</version> </dependency> <!-- JSTL --> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.2</version> </dependency> <!-- for compile only, your container should have this --> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <scope>provided</scope> </dependency>
3. Spring Controller
Spring comes with many Controllers, normally, you just need to extend the AbstractController, if you do not have other special requirement, and override the handleRequestInternal() method and return a ModelAndView object.
File : HelloWorldController.java
package com.mkyong.common.controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.AbstractController; public class HelloWorldController extends AbstractController{ @Override protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { ModelAndView model = new ModelAndView("HelloWorldPage"); model.addObject("msg", "hello world"); return model; } }
- ModelAndView(“HelloWorldPage”) – The “HelloWorldPage” will pass to Spring’s viewResolver later, to indentify which view should return back to the user. (see step 6)
- model.addObject(“msg”, “hello world”) – Add a “hello world” string into a model named “msg”, later you can use JSP EL ${msg} to display the “hello world” string.
4. View (JSP page)
In this case, “view” is a jSP page, you can display the value “hello world” that is store in the model “msg” via expression language (EL) ${msg}.
File : HelloWorldPage.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <html> <body> <h1>Spring MVC Hello World Example</h1> <h2>${msg}</h2> </body> </html>
If the ${msg} is displayed as it is, not the value inside the “msg” model, it may caused by the old JSP 1.2 descriptor, which make the expression languages disabled by default, see the solution here.
5. Spring Configuration
In web.xml, declared a DispatcherServlet servlet, named “mvc-dispatcher“, and act as the front-controller to handle all the entire web request which end with “htm” extension.
File : web.xml
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>Spring Web MVC Application</display-name> <servlet> <servlet-name>mvc-dispatcher</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>mvc-dispatcher</servlet-name> <url-pattern>*.htm</url-pattern> </servlet-mapping> </web-app>
The DispatcherServlet name “mvc-dispatcher“, is used to defined which file to load the Spring MVC configurations. By default, it will look for file by joining the servlet name “mvc-dispatcher” with “-servlet.xml” as the file name, in this case, it will find the “mvc-dispatcher-servlet.xml” file and load the Spring MVC configuration.
Alternatively, you can explicitly specify the Spring configuration file in the “contextConfigLocation” servlet parameter, to ask Spring to load your configurations besides the default “mvc-dispatcher-servlet.xml“.
File : web.xml
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>Spring Web MVC Application</display-name> <servlet> <servlet-name>mvc-dispatcher</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>mvc-dispatcher</servlet-name> <url-pattern>*.htm</url-pattern> </servlet-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/SpringMVCBeans.xml</param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> </web-app>
6. Spring Beans Configuration
Declared the Spring Controller and viewResolver.
File : mvc-dispatcher-servlet.xml
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> <bean name="/welcome.htm" class="com.mkyong.common.controller.HelloWorldController" /> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" > <property name="prefix"> <value>/WEB-INF/pages/</value> </property> <property name="suffix"> <value>.jsp</value> </property> </bean> </beans>
- Controller – Declared a bean name “/welcome.htm” and map it to HelloWorldController class. It means, if an URL with “/welcome.htm” pattern is requested, it will send to the HelloWorldController controller to handle the request.
- viewResolver – Define how Spring will looking for the view template. In this case, the controller “HelloWorldController” will return a ModelAndView object named “HelloWorldPage”, and the viewResolver will find the file with following mechanism : “prefix + ModelAndView name + suffix“, which is “/WEB-INF/pages/HelloWorldPage.jsp“.
Actually, you don’t need to define the BeanNameUrlHandlerMapping in the web.xml, by default, if no handler mapping can be found, the DispatcherServlet will creates a BeanNameUrlHandlerMapping automatically. See this article – BeanNameUrlHandlerMapping example for detail.
7. Demo
Run it and access via URL : http://localhost:8080/SpringMVC/welcome.htm , the “SpringMVC” is your project context name.

How it works?
- http://localhost:8080/SpringMVC/welcome.htm is requested.
- URL is end with “.htm” extension, so it will redirect to “DispatcherServlet” and send request to the default BeanNameUrlHandlerMapping.
- BeanNameUrlHandlerMapping return HelloWorldController to the DispatcherServlet.
- DispatcherServlet forward request to the HelloWorldController.
- HelloWorldController process it and return a ModelAndView object named “HelloWorldPage”.
- DispatcherServlet received the ModelAndView and call the viewResolver to process it.
- viewResolver return the “/WEB-INF/pages/HelloWorldPage.jsp” back to the DispatcherServlet.
- DispatcherServlet return the “HelloWorldPage.jsp” back to user.
You may interest at this Spring MVC hello world annotation example.
This is the best tutorial for me. But when i am trying to follow step by step for creating new maven + spring mvc hello world. i can not run this website. Anyone can help me.
type Status report
message /03exHelloWorldXML/welcome.html
description The requested resource (/03exHelloWorldXML/welcome.html) is not available.
——————————————————————————–
I couldn’t get it to work in InteliJ 10.5.1 until I updated line 16 of mvc-dispatcher-servlet.xml from
to
BUT this aside it’s the first Spring tutrial that I actually got to work!
Every thing is good , but when i import the project into my work space it is giving an error in red cross(X) mark
can not find tag descriptor http://java.sun.com/jsp/jstl/core
why it is , and how to resolve this.
thanks in advance
See step2 , Dependency library
You need to include the jstl dependency.
mallikarjuna YOu should use instead of
it’s cause you’re using Spring 3.05 version but autor of this article 2.56
Hi, Mkyong,
Thank you for the great tutorial. The 2 pictures in the beginning are great. They helped me to understand the common idea. I ran the demo from Eclipse with maven2Eclipse plugin.
I have 1 feedback about tutorial:
1) In the “HelloWorldController.java” file the view name should be with slash like “/HelloWorldPage”, not “HelloWorldPage”. When I run the application with “HelloWorldPage” the Tomcat server can not find the resource.
Note: In pom.xml file I added a dependency for servlet-api, because in Eclipse I had a compilation error(javax.serlet-classes missed). But in lib folder of Tomcat there is a servlet-api.jar file, so I think that the application will run without this dependency. Perhaps, in my case Tomcat will ignore my servlet-api.jar file.
Regards,
Tsvetan
Thanks for your invaluable feedback
. Will improve the article again, My Eclipse need serlvet-api.jar to compile, for this case, may be it should put in compile scope.
By the way, I just saw that the mistake with slash is mine. In the viewResolver’s configuration in “mvc-dispatcher-servlet.xml” for the prefix I put “/WEB-INF/pages”, not “/WEB-INF/pages/” as you. So the mistake is mine. I’m sorry for this spam.
Regards,
Tsvetan
Congratulations Mkyong!!! . It is the Excellent way to understand the basics.After I read this,I feel it is very easy to understand it’s advanced topics .
ya, usually, the baby step is the most important step.
when i refer to “localhost/MVCsample/welcome.htm”
get this error :
————————-
type Status report
message
description The requested resource () is not available.
============================
and when refer to “localhost/welcome.htm”
i will get
————————-
type Status report
message /WEB-INF/pages/HelloWorldPage.jsp
description The requested resource (/WEB-INF/pages/HelloWorldPage.jsp) is not available.
============================
where is the problem ?
Hi
where must define project context name?
here is SpringMVC, right ?
tanx
Thank you. It is explained nicely. I am able to do it quickly.
Thanks for nice artical. But when I am trying to run your code its giving me error message
No mapping found for HTTP request with URI [/com.mkyong.common_SpringMVC_war_1.0-SNAPSHOT/] in DispatcherServlet with name ‘mvc-dispatcher’
shows 404 error in browser.
Do I need to make any change in your mvc-dispatcher-servlet.xml file
Also when I am trying to import your project its not importing the servlet-api-2.5.jar automatically.
Please help me to resolve this isssue
Its working now …
So, what’s your problem and solution?
Hi mkyong,
I like your web site it’s really good for learning, I appreciate all your helps.
I am new here, I just downloaded SpringMVC-HelloWorld-Example.zip , extracted it, but don’t know how to open it in NetBeans or Eclipse.
Thanks lot.
Kamal
Sorry for the inconvenience caused. You can import the project into Eclipse easily.
1. Go to project path, run with Maven command ,
mvn eclipse:eclipse<—convert the project to Eclipse project.2. In Eclipse IDE, try import the converted project.
Hi,
I appreciate you reply and help.
I did mvn eclipse:eclipse
I have :
\src\main\java\com\mkyong\common\controller\HelloWorldController.java
\target\classes\ empty
\.settings\org.eclipse.wst.common.component
\.settings\org.eclipse.wst.common.project.facet.core.xml
\src\main\resources\ empty
src\main\webapp\WEB-INF\web.xml
src\main\webapp\WEB-INF\mvc-dispatcher-servlet.xml
\src\main\webapp\WEB-INF\pages\HelloWorldPage.jsp
How to convert this code to an eclipse project ?
Thanks lot.
When you issue “mvn eclipse:eclipse” , it makes your project supports Eclipse. In Eclipse IDE, just import the existing project.
To show the value of msg in the view it need to add on the top of view the following two lines
in this way ${msg} will work
bye
g.
javax.servlet.ServletException: javax.servlet.jsp.tagext.TagAttributeInfo.(Ljava/lang/String;ZLjava/lang/String;ZZLjava/lang/String;ZZLjava/lang/String;Ljava/lang/String;)V
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:274)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:236)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:257)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1183)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:902)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
note
Contact me via http://www.mkyong.com/contact-mkyong/ , and send me your project for debugging.
Mar 16, 2011 12:14:23 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.j2ee.server:SpringMVC’ did not find a matching property.
Mar 16, 2011 12:14:23 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:Test’ did not find a matching property.
Mar 16, 2011 12:14:23 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jre6\bin;C:\Program Files\Java\jdk1.6.0_15\bin;C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin;D:\Apache-Cassandra-0.6.2\bin
Mar 16, 2011 12:14:23 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 16, 2011 12:14:23 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 277 ms
Mar 16, 2011 12:14:23 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 16, 2011 12:14:23 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
Mar 16, 2011 12:14:23 PM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener “org.springframework.web.context.ContextLoaderListener” is already configured for this context. The duplicate definition has been ignored.
Mar 16, 2011 12:14:23 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
at java.lang.ClassLoader.findBootstrapClass(Native Method)
at java.lang.ClassLoader.findBootstrapClass0(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1275)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3786)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Mar 16, 2011 12:14:23 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Mar 16, 2011 12:14:23 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Mar 16, 2011 12:14:23 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/SpringMVC] startup failed due to previous errors
Mar 16, 2011 12:14:23 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 16, 2011 12:14:23 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 16, 2011 12:14:23 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/15 config=null
Mar 16, 2011 12:14:23 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 220 ms
Can’t find the
java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener, you can find this class in J2EE SDK library – javaee.jar. Or servlet-api.jarMar 16, 2011 10:43:34 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.j2ee.server:SpringMVC’ did not find a matching property.
Mar 16, 2011 10:43:34 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:Test’ did not find a matching property.
Mar 16, 2011 10:43:34 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jre6\bin;C:\Program Files\Java\jdk1.6.0_15\bin;C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin;D:\Apache-Cassandra-0.6.2\bin
Mar 16, 2011 10:43:34 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 16, 2011 10:43:34 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 275 ms
Mar 16, 2011 10:43:34 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 16, 2011 10:43:34 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
Mar 16, 2011 10:43:35 AM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener “org.springframework.web.context.ContextLoaderListener” is already configured for this context. The duplicate definition has been ignored.
Mar 16, 2011 10:43:35 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3786)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Mar 16, 2011 10:43:35 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Mar 16, 2011 10:43:35 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Mar 16, 2011 10:43:35 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/SpringMVC] startup failed due to previous errors
Mar 16, 2011 10:43:35 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 16, 2011 10:43:35 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 16, 2011 10:43:35 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/16 config=null
Mar 16, 2011 10:43:35 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 210 ms
see this link http://www.mkyong.com/spring/spring-error-classnotfoundexception-org-springframework-web-context-contextloaderlistener/
I just tried to use the source code given by you. I am getting error 404. If you give me your email address, I can send you a screen shot of the project structure and the webpage.
contact me here – http://www.mkyong.com/contact-mkyong/
Wow this is a great resource.. I’m enjoying it.. good article
I’m trying to run this project and it work fine when I it from console, but when I want to do it from Eclipse it reports
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener.
I have tried to import spring-framework-3.0.5.RELEASE jar files and it reports
java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener.
You need to include the J2EE library “javaee.jar” in your Eclipse class path.
http://download.oracle.com/javaee/5/api/javax/servlet/ServletContextListener.html
you have demonstrated in a very well manner… picture and flow and then example helped me a lot in learning…
thanx mykyong… i bookmarked it long back..
Thanks for your kind words, good to know it did help someone.
It would be great help if you could upload some database connectivity example…
Thanks mkyong
sorry.. i found it on your other pages.
Enjoy studying Spring MVC
Hi,
Thanks mykyong author…
This example gives very clear picture about learning spring technology..
very well designed examples for new bees…
very appreciating…
Thanks for uploading such a nice and simple example – it helped me a lot in clearing my concepts regarding Spring framework
Welcome, good to know it did help someone
Thanks a lot for the tutorial . You are a very good teacher & the programmer. Keep on Rocking . I am a student of you.
“Any fool can write code that a computer can understand.
Good programmers write code that humans can understand.” — Martin Fowler
Thanks for your kind words, we all learn through the processes.
[...] Spring MVC hello world example A XML-based Spring MVC hello world example. [...]
[...] hello world example. Note This annotation-based example is converted from the last Spring MVC hello world XML-based example. So, please compare and spots the [...]