The requested resource (/) is not available

后端 未结 1 1185
别那么骄傲
别那么骄傲 2021-01-29 02:24

I have just started learning Spring MVC 3 and I have problem right at the start with running simple hello world program

I\'m trying to get this up and running, but i cant

相关标签:
1条回答
  • 2021-01-29 03:07

    @Tenelope you need not return "WEB-INF/views/home.jsp"; you can just return "home" as you have it configured in your servlet-context :

        <beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <beans:property name="prefix" value="/WEB-INF/views/" />
            <beans:property name="suffix" value=".jsp" />
        </beans:bean> 
    

    My advice to you would be to download the spring source(eclipse like IDE) :

    http://www.springsource.org/springsource-tool-suite-download

    After downloading it you can simply go to File > New > Spring Template Project > Spring MVC project

    After you're done with creating project, the working template project(structured project, example controller file, example view, pom.xml etc.) will be created for you. Including the "/" example you're talking about. You can just build it and deploy it to tomcat or whatever.

    This way you already get working example and you can take it from there.

    Btw. check this out :

    https://github.com/SpringSource/spring-mvc-showcase/blob/master/MasteringSpringMVC3.pdf?raw=true

    It is enough to get you started well off with Spring MVC.

    0 讨论(0)
提交回复
热议问题