Results 1 to 2 of 2

Thread: Spring MVC

  1. #1
    vitaliy1901 is offline Member
    Join Date
    Sep 2012
    Rep Power

    Default Spring MVC

    Hi every one! I have been learning spring mvc, but I get error page 404 when I started tomcat server and went to URL http://localhost:8080/HelloWorld/welcome.htm. What's wrong with my code or structure? Thanks for help!

    # my structure:
    Spring MVC-1.jpg

    Java Code:
    package controller;
    import org.springframework.web.servlet.ModelAndView;
    import org.springframework.web.servlet.mvc.AbstractController;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class HelloWorldController extends AbstractController{
        protected ModelAndView handleRequestInternal(HttpServletRequest request,
                                                     HttpServletResponse response) throws Exception {
            ModelAndView model = new ModelAndView("HelloWorldPage");
            model.addObject("msg", "hello world");
            return model;
    # web.xml
    Java Code:
    <web-app id="WebApp_ID" version="2.4"
    	xmlns="" xmlns:xsi=""
    	<display-name>Spring Web MVC Application</display-name>
    # mvc-dispatcher-servlet.xml
    Java Code:
    <beans xmlns=""
    	<bean id="viewResolver"
    		<property name="prefix">
    		<property name="suffix">
    	<bean name="/welcome.htm" 
    		class="controller.HelloWorldController" />

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: Spring MVC

    Moved from New to Java

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. new to spring mvc with JPA
    By javastuden in forum New To Java
    Replies: 0
    Last Post: 07-26-2011, 10:25 AM
  2. spring with jpa help please help me
    By javastuden in forum Advanced Java
    Replies: 0
    Last Post: 07-08-2011, 05:41 PM
  3. Spring IoC
    By videanuadrian in forum Advanced Java
    Replies: 6
    Last Post: 07-08-2011, 11:42 AM
  4. Replies: 1
    Last Post: 12-27-2010, 06:21 PM
  5. spring mvc
    By karq in forum Advanced Java
    Replies: 0
    Last Post: 12-13-2010, 05:28 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts