資源簡介
SSM框架(IDEA+Spring+SpringMVC+Maven+Mybatis),搭建SSM框架,數據庫采用MySQL數據庫,利用MyBatis-generator 自動生成MyBatis代碼

代碼片段和文件信息
package?com.system.controller;
import?com.fasterxml.jackson.databind.objectMapper;
import?com.system.mapper.UserMapper;
import?com.system.model.User;
import?com.system.service.UserService;
import?org.springframework.beans.factory.annotation.Autowired;
import?org.springframework.stereotype.Controller;
import?org.springframework.web.bind.annotation.GetMapping;
import?org.springframework.web.bind.annotation.RequestMapping;
import?javax.servlet.http.HttpServletRequest;
import?javax.servlet.http.HttpServletResponse;
import?java.io.IOException;
/**
?*?Created?by?Administrator?on?2017/8/17.
?*/
@Controller
@RequestMapping(“/user“)
public?class?UserController?{
????@Autowired
????private?UserService?userService;
????@Autowired
????private?UserMapper?userMapper;
????@GetMapping(“/demo“)
????public?String?test()?{
????????return?“findUser“;
????}
????@RequestMapping(“/user/showUser.do“)
????public?void?selectUser(HttpServletRequest?request?HttpServletResponse?response)?throws?IOException?{
????????request.setCharacterEncoding(“UTF-8“);
????????response.setCharacterEncoding(“UTF-8“);
????????Integer?userId?=?Integer.parseInt(request.getParameter(“id“));
????????User?user?=?userMapper.selectByPrimaryKey(userId);
????????objectMapper?mapper?=?new?objectMapper();
????????response.getWriter().write(mapper.writeValueAsString(user));
????????response.getWriter().close();
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-12-04?15:46??SSM\
?????文件????????5604??2017-08-17?17:25??SSM\pom.xm
?????目錄???????????0??2017-08-18?09:44??SSM\sql\
?????文件????????1274??2017-08-17?17:38??SSM\sql\test.sql
?????目錄???????????0??2017-08-18?09:44??SSM\src\
?????目錄???????????0??2017-08-18?09:44??SSM\src\main\
?????目錄???????????0??2017-08-18?09:44??SSM\src\main\java\
?????目錄???????????0??2017-08-18?09:44??SSM\src\main\java\com\
?????目錄???????????0??2017-08-18?09:44??SSM\src\main\java\com\system\
?????目錄???????????0??2017-12-04?15:12??SSM\src\main\java\com\system\controller\
?????文件????????1439??2017-12-04?15:12??SSM\src\main\java\com\system\controller\UserController.java
?????目錄???????????0??2017-12-04?15:15??SSM\src\main\java\com\system\mapper\
?????文件?????????992??2017-08-22?11:56??SSM\src\main\java\com\system\mapper\UserMapper.java
?????文件?????????948??2017-12-04?15:15??SSM\src\main\java\com\system\mapper\UserMapper.java.1
?????目錄???????????0??2017-12-04?15:16??SSM\src\main\java\com\system\model\
?????文件?????????561??2017-08-22?11:47??SSM\src\main\java\com\system\model\User.java
?????文件???????11456??2017-08-22?11:47??SSM\src\main\java\com\system\model\UserExample.java
?????目錄???????????0??2017-12-04?15:12??SSM\src\main\java\com\system\service\
?????文件?????????311??2017-12-04?15:12??SSM\src\main\java\com\system\service\UserService.java
?????目錄???????????0??2017-12-04?15:12??SSM\src\main\java\com\system\service\impl\
?????文件?????????736??2017-12-04?15:12??SSM\src\main\java\com\system\service\impl\UserServiceImpl.java
?????目錄???????????0??2017-08-18?09:44??SSM\src\main\resources\
?????文件????????3012??2017-08-17?14:18??SSM\src\main\resources\generatorConfig.xm
?????文件?????????161??2017-08-17?16:48??SSM\src\main\resources\jdbc.properties
?????文件?????????640??2017-08-17?17:17??SSM\src\main\resources\log4j.xm
?????目錄???????????0??2017-08-22?11:47??SSM\src\main\resources\mapper\
?????文件???????13066??2017-12-04?15:15??SSM\src\main\resources\mapper\UserMapper.xm
?????文件????????1332??2017-08-17?17:28??SSM\src\main\resources\mybatis-config.xm
?????文件????????1254??2017-08-17?16:21??SSM\src\main\resources\spring-config.xm
?????文件????????1893??2017-08-17?15:56??SSM\src\main\resources\spring-mvc.xm
?????文件????????2889??2017-08-17?17:22??SSM\src\main\resources\spring-mybatis.xm
............此處省略6個文件信息
- 上一篇:防止SQL注入和XSS攻擊Filter
- 下一篇:sql練習語句
評論
共有 條評論