这篇文章总结一下spring mvc的基本配置,首先贴一张我的项目的目录截图,有一些多余的文件,大家不必在意:

玩转Spring MVC(三)----spring基本配置文件

用到的一些jar包在这:<a>http://download.csdn.net/detail/u012116457/8426199</a>

玩转Spring MVC(三)----spring基本配置文件

接下来是web.xml的配置:


接下来是springMVC-servlet.xml:

这些就是spring mvc最基础的配置,下面是一个控制类的实例:

package module.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/start")   
public class StartController {

	private static String START="module/jsp/start";
	 
	@RequestMapping("/index.do")   
	public String start(HttpServletRequest request){
		return START;
	}
}
这样在浏览器中输入:http://localhost:8080/springMVC/start/index.do即可访问到start.jsp页面


版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-23
  • 2021-11-15
  • 2022-01-26
  • 2021-08-21
猜你喜欢
  • 2021-12-03
  • 2021-12-25
  • 2021-06-21
  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
相关资源
相似解决方案