# 20220620springMVC **Repository Path**: c90005471/springmvc20220620 ## Basic Information - **Project Name**: 20220620springMVC - **Description**: Spring MVC是一个基于Java的实现了MVC设计模式的请求驱动类型的轻量级Web框架,通过把Model,View,Controller分离,将web层进行职责解耦,把复杂的web应用分成逻辑清晰的几部分,简化开发,减少出错,方便组内开发人员之间的配合。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-06-20 - **Last Updated**: 2022-06-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 20220620springMVC #### 介绍 Spring MVC是一个基于Java的实现了MVC设计模式的请求驱动类型的轻量级Web框架,通过把Model,View,Controller分离,将web层进行职责解耦,把复杂的web应用分成逻辑清晰的几部分,简化开发,减少出错,方便组内开发人员之间的配合。 #### 软件架构 软件架构说明 #### 安装教程 1. xxxx 2. xxxx 3. xxxx #### 使用说明 步骤: 创建一个web项目 引入jar spring springjdbc springmvc mysql druid servlet jstl 编写配置文件 web.xml contextConfigLocation classpath:applicationContext.xml org.springframework.web.context.ContextLoaderListener aaaServlet org.springframework.web.servlet.DispatcherServlet contextConfigLocation classpath:springMVC.xml aaaServlet *.do applicationContext.xml springMVC.xml 编写代码 package com.aaa.controller; import com.aaa.entity.Userinfo; import com.aaa.service.UserInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; import java.util.Enumeration; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @author :Teacher陈(86521760@qq.com) * @date :Created in 2022/6/20 9:25 * @description: * @modified By: * @version: */ @Controller @RequestMapping("userinfoMVC") public class UserInfoMVCController { @Autowired private UserInfoService userInfoService; @RequestMapping("findAllUser.do") public String findAllUser(HttpSession httpSession){ System.out.println("请求到达"); List userinfoList = userInfoService.findAllUser(); for (Userinfo userinfo : userinfoList) { System.out.println(userinfo.toString()); } httpSession.setAttribute("userinfoList",userinfoList); return "aaa"; } } 测试 #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)