springBoot
T-hs
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
java文件读取与保存
文件读取与保存 Long startTime=System.currentTimeMillis(); String jsonStr = ""; try { File jsonFile = new File("E:\\json\\"+ "json" + ".json"); FileReader fileReader = new FileReader(jsonFile); Reader reader = new InputStreamReader(new FileInputStre原创 2021-08-27 15:11:40 · 1067 阅读 · 0 评论 -
二进制流与base64位相互转换
二进制流与base64位相互转换 base64传到前端需要有文件头来区分 先自己定义一个 /** * 图片base64格式Map */ private static final Map<String, String> DATA_IMAGE_MAP = new HashMap<String, String>() { { put("png", "data:image/png;base64,"); put("jpg", "data:image/jpeg;base6原创 2021-08-11 10:12:58 · 3005 阅读 · 0 评论 -
下载附件,以二进制流的形式
下载文件 /** * 根据附件信息下载附件 * * @param attachment 附件对象 * @param response 响应对象 * @throws IOException IO流异常 */ public static void download(FbAttachment attachment, HttpServletResponse response) throws IOException { if (null == attachment) { th原创 2021-08-11 10:04:52 · 357 阅读 · 0 评论 -
springboot中shiro权限控制的使用
springboot中shiro权限控制的使用 先新建一个UserRealm public class UserRealm extends AuthorizingRealm { //授权 @Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) { System.out.println("执行了=>Authorizat原创 2021-02-17 21:29:48 · 295 阅读 · 1 评论 -
springBoot中Security的使用
springBoot中Security的使用 需要有自动装配 @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { //链式编程 @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests()原创 2021-02-17 21:25:56 · 457 阅读 · 0 评论 -
SpringBoot拦截器的使用
SpringBoot拦截器的使用 新建类继承HandlerInterceptor //拦截器 public class LoginHandlerInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {原创 2021-02-17 21:23:10 · 253 阅读 · 0 评论 -
springBoot的mcv(视图)控制
springBoot的mcv(视图)控制 新建个类,继承WebMvcConfigurer 类名上加注解@Configuration @Configuration public class MyMvcConfig implements WebMvcConfigurer { //视图 @Override public void addViewControllers(ViewControllerRegistry registry) { //当return:“test”时就会跳转到“原创 2021-02-17 21:14:38 · 313 阅读 · 0 评论
分享