Spring无法在服务器上运行哪里出错?

时间:2016-07-29 09:39:26

标签: spring spring-mvc spring-boot

enter code here我是春天新手,我输入了一个程序,但它没有在服务器上运行我不知道下面的问题在哪里是代码

的web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>FirstSpringMVCProject</display-name>
 <servlet>
 <servlet-name>spring-dispatcher</servlet-name>
 <servlet-class>
 org.springframework.web.servlet.DispatcherServlet
 </servlet-class>
 </servlet>
 <servlet-mapping>
 <servlet-name>spring-dispatcher</servlet-name>
 <url-pattern>/</url-pattern>
 </servlet-mapping>
</web-app>

弹簧调度-servlet.xml中

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" >

<bean id="HandlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" />
<bean id="/welcom.html" class="com.ismail.hellocontroller.HelloController"></bean>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
</beans>

HelloController中

package com.ismail.hellocontroller;

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 HellloController extends AbstractController {
    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) 
    {
    ModelAndView modelandview = new ModelAndView("HelloPage");
    modelandview.addObject("welcomemessage","Hi User , WelCome to The First MVC Project");
    return modelandview;
    }

}

当我开始运行程序时,它显示以下错误 RuntimeError

/HelloPage.jsp

0 个答案:

没有答案