当前位置: 首页 > news >正文

如何查看网站的流量免费建站的网站哪个好

如何查看网站的流量,免费建站的网站哪个好,做网站建设要学多久,学习搭建网站主要内容 1. SpringBoot简介 2. 构建springboot工程 3. springboot接口返回json 4. springboot热部署 5. springboot资源属性配置 6. springboot整合模板引擎 7. springboot异常处理 8. springboot整合MyBatis 9. springboot整合redis 10. springboot整合定时任务 11. springbo… 主要内容 1. SpringBoot简介 2. 构建springboot工程 3. springboot接口返回json 4. springboot热部署 5. springboot资源属性配置 6. springboot整合模板引擎 7. springboot异常处理 8. springboot整合MyBatis 9. springboot整合redis 10. springboot整合定时任务 11. springboot整合异步任务以及使用场景 12. springboot中如何使用拦截器 1. SpringBoot简介 SpringBoot特点 基于spring 使开发者快速入门门槛较低Springboot可以创建独立运行的应用而不依赖于容器不需要打包成war包可以放入tomcat直接运行提供maven极简配置缺点是会引入很多你不需要的包根据项目来依赖从而配置spring需要什么配什么提供可视化的相关功能方便监控比如性能应用的健康程度等简化配置不用再看过多的xml为微服务SpringCloud铺路 SpringBoot可以整合很多各式各样的框架来构建微服务比如dubbo thrift等等 2. 构建springboot工程 Reference: https://blog.csdn.net/typa01_kk/article/details/76696618 3. springboot接口返回json SpringBoot构造并返回一个json对象 package com.firsttry.helloworld.controller;import com.firsttry.helloworld.pojo.IMoocJSONResult; import com.firsttry.helloworld.pojo.User; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController;import java.util.Date;//Controller RestController //RestController Controller ResponseBody RequestMapping(/user) public class UserController {RequestMapping(/getUser)/*表示将返回的数据封装成json字符串*///ResponseBodypublic User getUser(){User u new User();u.setName(Alisa);u.setAge(21);u.setBirthday(new Date());u.setPassword(111111111);u.setDesc(hello I hope I can be much happier, hahahah);return u;}RequestMapping(/getUserJson)/*表示将返回的数据封装成json字符串*///ResponseBodypublic IMoocJSONResult getUserJson(){User u new User();u.setName(Alisa);u.setAge(21);u.setBirthday(new Date());u.setPassword(111111);u.setDesc(emmmmmm11122222);return IMoocJSONResult.ok(u);} } Jackson的基本演绎法 package com.firsttry.helloworld.pojo;import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude;import java.util.Date;public class User {private String name;JsonIgnoreprivate String password;private Integer age;JsonFormat(pattern yyyy-MM-dd hh:mm:ss a, locale Aus, timezone GMT10)private Date birthday;JsonInclude(JsonInclude.Include.NON_NULL)private String desc;public String getName() {return name;}public void setName(String name) {this.name name;}public String getPassword() {return password;}public void setPassword(String password) {this.password password;}public Integer getAge() {return age;}public void setAge(Integer age) {this.age age;}public Date getBirthday() {return birthday;}public void setBirthday(Date birthday) {this.birthday birthday;}public String getDesc() {return desc;}public void setDesc(String desc) {this.desc desc;} } 4. springboot热部署 SpringBoot使用devtools进行热部署不需要重启服务器就可以部署文件 Reference: https://www.jianshu.com/p/0e3efd50e3e3 5. springboot资源属性配置 6. springboot整合模板引擎 1. springBoot整合freemarker pom.xml !--引入freemarker模板依赖--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-freemarker/artifactId/dependencyapplication.properties ######## # # freemarker 静态资源配置 # ######## # 设定ftl文件路径 spring.freemarker.template-loader-pathclasspath:/templates # 关闭缓存即时刷新上线生产环境需改为true spring.freemarker.cachefalse spring.freemarker.charsetUTF-8 spring.freemarker.check-template-locationtrue spring.freemarker.content-typetext/html spring.freemarker.expose-request-attributestrue spring.freemarker.expose-session-attributestrue spring.freemarker.request-context-attributerequest spring.freemarker.suffix.ftlfreemarkerController package com.firsttry.helloworld.controller;import com.firsttry.helloworld.pojo.Resource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping;Controller RequestMapping(ftl) public class FreemarkerController {Autowiredprivate Resource resource;RequestMapping(/index)public String index(ModelMap map){map.addAttribute(resource, resource);return freemarker/index;}RequestMapping(center)public String center(){return freemarker/center/center;}} 2. springBoot整合thymeleaf pom.xml !--引入thymeleaf模板依赖--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-thymeleaf/artifactId/dependencyapplication.properties ######## # # thymeleaf 静态资源配置 # ######## spring.thymeleaf.prefixclasspath:/templates/ spring.thymeleaf.suffix.html spring.thymeleaf.modeHTML5 spring.thymeleaf.encodingUTF-8 spring.thymeleaf.servlet.content-typetext/html # 关闭缓存即时刷新上线生产环境需要改为true spring.thymeleaf.cachefalseThymeleafController package com.firsttry.helloworld.controller;import com.firsttry.helloworld.pojo.User; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping;import java.util.ArrayList; import java.util.Date; import java.util.List;Controller RequestMapping(th) public class ThymeleafController {RequestMapping(/index)public String index(ModelMap map){map.addAttribute(name, thymeleaf-imooc);return thymeleaf/index;}RequestMapping(center)public String center() {return thymeleaf/center/center;}RequestMapping(test)public String test(ModelMap map) {User u new User();u.setName(manager);u.setAge(10);u.setPassword(123465);u.setBirthday(new Date());u.setDesc(font colorgreenbhello imooc/b/font);map.addAttribute(user, u);User u1 new User();u1.setAge(19);u1.setName(imooc);u1.setPassword(123456);u1.setBirthday(new Date());User u2 new User();u2.setAge(17);u2.setName(superadmin);u2.setPassword(123456);u2.setBirthday(new Date());ListUser userList new ArrayListUser();userList.add(u);userList.add(u1);userList.add(u2);map.addAttribute(userList, userList);return thymeleaf/test;}PostMapping(postform)public String postform(User u) {System.out.println(姓名 u.getName());System.out.println(年龄 u.getAge());return redirect:/th/test;} } thymeleaf常用标签的使用方法 基本使用方式对象引用方式时间类型转换text与utext的比较 utext: html代码会解析成对应的css代码URL引入静态资源条件判断th:ifth:unless 与 th:if 的使用循环 th:eachtext 与 utextth:switch 与 th:case 7. springboot异常处理 页面跳转形式ajax形式统一返回异常的形式 8. springboot整合MyBatis 使用generatorConfig生成mapper以及pojo实现基于mybatis的CRUD功能整合mybatis-pagehelper实现分页自定义mapper的实现 SpringBoot整合持久层事务为数据库操作设定事务级别 事务隔离级别DEFAULT READ_UNCOMMITTED READ_COMMITTED REPEATABLE_READ SERIALIZABLE -事务的传播行为REQUIRED SUPPORTS MANDATORY REQUIRES_NEW NOT_SUPPORTED NEVER NESTED 9. springboot整合redis pom.xml引入需要的依赖资源文件中对redis进行配置引入redis工具类 10. springboot整合定时任务task 使用注解EbableScheduling开启定时任务会自动扫描定义Component作为组件被容器扫描表达式生成地址: https://cron.qqe2.com/ 11. springboot整合异步任务以及使用场景 使用注解EnableAsync开启异步会自动扫描定义Component Async作为组件被容器扫描执行 12. springboot中如何使用拦截器 使用注解Configuration配置拦截器继承WebMvcConfigurerAdapter重写addInterceptors添加需要的拦截器地址 本文主要参考源码https://github.com/leechenxiang/imooc-springboot-starter © 著作权归作者所有,转载或内容合作请联系作者 喜欢的朋友记得点赞、收藏、关注哦
http://www.dnsts.com.cn/news/48691.html

相关文章:

  • 网站建设维护问题四川省住房和城乡建设局网站首页
  • 十堰微网站建设报价南沙企业网站建设
  • 网站自助建设平台官方网站app最新下载
  • 上海八号桥 网站建设在重庆 那里可以做诚信网站认证
  • 做网站的毕设开题依据网站在百度无法验证码怎么办啊
  • 网站开头flash怎么做企业 办公 网站模板下载
  • 通辽北京网站建设报ui设计班
  • 做网站排行室内效果图制作流程
  • 2015年网站设计巢湖路桥建设集团网站
  • 广州铁路投资建设集团网站大学生做微商网站
  • 2345网址导航手机版下载导购网站的seo怎么做
  • 深圳seo网站建设制作网站图文教程
  • 网站开发南城科技大厦变更icp备案网站信息查询
  • 适合服务行业做推广的网站南京网站制作工具
  • 网站安全认证去哪做山东网站建设平台
  • 网站开发包括软件吗一个虚拟主机可以做几个网站吗
  • 学做网站培训螺蛳粉营销策划方案
  • 嵩明网站建设深圳食品网站建设
  • wordpress数据库连接时错误企业网站怎么优化
  • 免费不良正能量网站链接网站开发培训 价格
  • 南通建公司网站离职同事以公司名义做网站
  • python做网站原理wordpress改地址错误
  • 怎么做网站点击率监控工具网站推广托管
  • 农药放行单在哪个网站做wordpress搭建电商教程
  • dede如何手机网站和电脑网站的数据同步更新做网站需要知道哪些事情
  • 在建立网站站点的过程中深圳代理记账多少钱一月
  • 查询公司信息去哪里查aso优化什么意思
  • 网站备案一天通过html新闻列表
  • 网站 前台 后台h5响应式网站
  • 同安建设局网站网站建设及网站推广