一个简单的springmvc程序
1、@Controller@RequestMapping("/hello")这就是传说中的spring。controller是一个顶层的结构requestMapping是一个映射的地址下图是:HelloController.java代码

3、<?xml version="1.0" encoding="UTF-8"?>稆糨孝汶;<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" 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-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd"> <context:component-scan base-package="Com.spring" /> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/jsp/" /> <property name="suffix" value=".jsp" /> </bean></beans>beans是头文件context是包文件bean是路径property是在/WEB-INF/jsp/之下的jsp文件

5、如果我们的代码没有错,就可以起动项目,如果在下面console中没有报错,说明我们的代码是没有什么问题的,就可以在访问路径中修改一下。@RequestMapping("/hello")http://localhost:8080/HelloWeb/hello
