0
봄 2.6 버전을 사용하여 간단한 봄 mvc 신청을 개발하는 것을 시도해서.간단한 봄 mvc 신청 도중 페이지를 찾을 수 없다
이것은 내 web.xml 파일 콘텐츠입니다.
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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" >
<servlet>
<servlet-name>springtutorial</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springtutorial</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
</web-app>
이이 내 컨트롤러 파일
패키지 닷컴입니다
j2ee.jar
jstl.jar
spring.jar
spring-webmvc.jar
lib 폴더 아래에 내 응용 프로그램 서블릿 설정 파일 "springtutorial-servlet.xml에"
<?xml version="1.0" encoding="UTF-8"?>
<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 id="helloController" class="com.net.technicalkeeda.controller.HelloController" />
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="hello.htm">helloController</prop>
</props>
</property>
</bean>
</beans>
항아리입니다 .net.technicalkeeda.controller;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
public class HelloController implements Controller {
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
System.out.println("I am here");
return new ModelAndView("hello.jsp");
}
}
URL을 통해 액세스 할 수없는 바람둥이 프로젝트 배포 후
http://domainname.com/springtutorial/hello.htm
당신은 문제