系统架构搭建-Maven Spring Ibatis
文章待续:
前序工作:
eclipse 编码设置:http://blog.csdn.net/wodwl/article/details/7737620
eclipse 自动补全设置:http://blog.csdn.net/wodwl/article/details/7717938
eclipse xml提示设置:http://blog.csdn.net/wodwl/article/details/7717828
1、创建Maven程序并转换成Dynamic Web Project
http://blog.163.com/liuweiyoung@126/blog/static/17313104520125210739180/
2、在pom.xml文件中添加依赖
maven 参考:http://blog.csdn.net/wodwl/article/details/7702450
package com.wodwl.controller;import java.util.HashMap; import java.util.Map; 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 UserController implements Controller { private String add_view; private String display_view; private String list_view; private String update_view; public String getAdd_view() {return add_view;}public void setAdd_view(String add_view) {this.add_view = add_view;}public String getDisplay_view() {return display_view;}public void setDisplay_view(String display_view) {this.display_view = display_view;}public String getList_view() {return list_view;}public void setList_view(String list_view) {this.list_view = list_view;}public String getUpdate_view() {return update_view;}public void setUpdate_view(String update_view) {this.update_view = update_view;}@Override public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { Map model = new HashMap(); model.put("msg", "hello nice to meet you"); return new ModelAndView(getAdd_view(), model); } }