springmvc可以接受传入的API: HttpServletRequest HttpServletResponse HttpSession java.security.Principal InputStream OutputStream Reader Writer @RequestMapping ...
                            
                            
                                分类:
编程语言   时间:
2020-01-10 22:37:12   
                                阅读次数:
136
                             
                    
                        
                            
                            
                                    @RequestMapping不仅可以修饰类,也可以修饰方法。 总而言之,用@RequestMapping标识的是请求的URL地址。例如: package com.gong.springmvc.handlers; import org.springframework.stereotype.Contr ...
                            
                            
                                分类:
移动开发   时间:
2020-01-10 15:58:27   
                                阅读次数:
106
                             
                    
                        
                            
                            
                                    可以使用method指定请求的方式: package com.gong.springmvc.handlers; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotati ...
                            
                            
                                分类:
移动开发   时间:
2020-01-10 15:43:53   
                                阅读次数:
85
                             
                    
                        
                            
                            
                                    当时导入的时候用的openCsv,那么导出的时候自然也是用这个,查了好多资料才找到解决方案,下面记录一下实现过程。 1.Controller层: /** * 导出csv文件 */ @RequestMapping("/exportcsv") @RequiresPermissions("xxx:xxxx ...
                            
                            
                                分类:
编程语言   时间:
2020-01-10 12:13:02   
                                阅读次数:
450
                             
                    
                        
                            
                            
                                    前两天干活儿的时候有个需求,前台导入csv文件,后台要做接收处理,mysql数据库中,项目用的springboot+Vue+mybatisPlus实现,下面详细记录一下实现流程。 1.Controller层部分: /** * 读取csv文件,批量插入到数据库中 */ @RequestMapping( ...
                            
                            
                                分类:
数据库   时间:
2020-01-09 18:34:41   
                                阅读次数:
135
                             
                    
                        
                            
                            
                                    背景 已经明确了MVC的思想和SpringMVC的基本流程,下面就都具体的mvc开发细节知识了。 @RequestMapping springMVC核心流程中,启动阶段会把注解@RequeestMapping注解所配置的内容保存到HandlerMapping中,然后等待请求到达。 看一下源码: 简单 ...
                            
                            
                                分类:
编程语言   时间:
2020-01-05 22:22:26   
                                阅读次数:
81
                             
                    
                        
                            
                            
                                URL请求处理流程: 1. URL处理方法映射 1.1 Controller 页面控制器,内部可以包含处理具体请求的方法(@RequestMapping)。 @Controller:返回视图,如jsp或者html文件; @RestController:返回JSON,如字符串,或者数组; 1.2 @R ...
                            
                            
                                分类:
编程语言   时间:
2020-01-05 22:19:42   
                                阅读次数:
176
                             
                    
                        
                            
                            
                                    @RequestMapping("/") public void a(HttpServletRequest request) { System.out.println(request.getRemoteAddr()); //ng的地址 System.out.println(request.getHe ...
                            
                            
                                分类:
编程语言   时间:
2020-01-05 09:30:38   
                                阅读次数:
95
                             
                    
                        
                            
                            
                                    @RequestMapping RequestMapping是一个用来处理请求地址映射的注解,可用于类或方法上。用于类上,表示类中的所有响应请求的方法都是以该地址作为父路径。 @Autowired @Autowired 是一个注释,它可以对类成员变量、方法及构造函数进行标注,让 spring 完成  ...
                            
                            
                                分类:
移动开发   时间:
2020-01-04 14:14:12   
                                阅读次数:
74
                             
                    
                        
                            
                            
                                    多文件保存到本地: @ResponseBody @RequestMapping(value = "/uploadApp",produces = { "application/json;charset=UTF-8" },method= RequestMethod.POST) public String ...
                            
                            
                                分类:
编程语言   时间:
2020-01-02 19:08:57   
                                阅读次数:
113