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

南昌高端网站开发费用表域名价格排行

南昌高端网站开发费用表,域名价格排行,山东省济宁市嘉祥县建设局网站,北京建设住房和城乡建设官网Thymeleaf同jsp、volocity、freemarker等共同的职能是MVC模式中的视图展示层#xff0c;即View。 当然了#xff0c;SpringBoot中也可以用jsp,不过不推荐这种用法#xff0c;比较推崇的就是使用Thymeleaf。 关于Thymeleaf学习#xff0c;建议参考官方文档:https://www.thym…Thymeleaf同jsp、volocity、freemarker等共同的职能是MVC模式中的视图展示层即View。 当然了SpringBoot中也可以用jsp,不过不推荐这种用法比较推崇的就是使用Thymeleaf。 关于Thymeleaf学习建议参考官方文档:https://www.thymeleaf.org/documentation.html 官方文档例子应有尽有。 之前接触过Thymeleaf是因为公司项目初建期间用过它搭建过测试环境后来根据领导的指示需要快速开发而且当时对于Thymeleaf不是十分了解当时对于它的了解认识只是展示前端数据的同jsp职能一样当然这也是它们的共性。比较详细的深入了解和使用是帮助一位学妹解决毕业论文的项目问题。那时帮助她写了好十几个类代码和对应的十几个html代码。当时感触比较深的是Thymeleaf是如此的好用比jsp还好用jsp要遍历之类要么加%%或者引用jstl标签库进行数据遍历等。而Thymeleat就不需要。简洁直观我比较推崇Thymeleaf特别是在前后端分离的项目有的时候不用jsp,光纯htmljs的确有点吃力即便使用了vue.js或者angular.js、react.js等虽然增加了便利性但是了如果一个项目前端语言不是十分统一的话对于将来维护成本方面会大大提高不易维护。 Thymeleaf对于前后端分离我认为还是不错的。   下面进入demo例子讲解   一、导入maven依赖 ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersiongroupIdorg.springframework/groupIdartifactIdgs-uploading-files/artifactIdversion0.1.0/versionparentgroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-parent/artifactIdversion1.5.8.RELEASE/version/parentpropertiesjava.version1.8/java.version/propertiesdependenciesdependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId/dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-thymeleaf/artifactId/dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-test/artifactIdscopetest/scope/dependency/dependenciesbuildpluginsplugingroupIdorg.springframework.boot/groupIdartifactIdspring-boot-maven-plugin/artifactId/plugin/plugins/build/project   二、编写实体 package hello;public class User {private Integer id;private String name;public Integer getId() {return id;}public void setId(Integer id) {this.id id;}public String getName() {return name;}public void setName(String name) {this.name name;}}   三、编写Controller package hello;import java.util.ArrayList; import java.util.List;import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping;Controller public class TestController {GetMapping(value/test)public String test(Model model) {ListUser userList new ArrayListUser();for (int i 0; i 10; i) {User user new User();user.setId(1);user.setName(张三);userList.add(user);}model.addAttribute(users, userList);return test;} }   四、编写配置文件,将其放置在/src/main/resources下 application.properties server.port8080 spring.thymeleaf.cachefalse spring.thymeleaf.prefixclasspath:/templates/ spring.thymeleaf.check-template-locationtrue spring.thymeleaf.suffix.html spring.thymeleaf.encodingUTF-8 spring.thymeleaf.content-typetext/html spring.thymeleaf.modeHTML5   五、在src/main/resources目录下新建templates目录并新建html文件 test.htm html xmlns:thhttp://www.thymeleaf.org bodyh2用户列表/h2divulli th:eachuser:${users}span th:text${user.id}/span-span th:text${user.name}/span-/li/ul/div /body /html   六、编写启动类 package hello;import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;SpringBootApplication public class Application {public static void main(String[] args) {SpringApplication.run(Application.class, args);}}   最后结果如下图所示: 这里没有加入mysql或者其他数据相关的如果要引用数据库引用对应数据库的依赖和配置对应的数据库连接池即可。 这里可以参考我的关于SpringbootMyBatisThymeleaf 示例地址为:https://github.com/youcong1996/springboot-mybatis-demo转载于:https://www.cnblogs.com/youcong/p/9385918.html
http://www.pierceye.com/news/227381/

相关文章:

  • 婚纱网站源代码网站制作专业的公司
  • 公司经营范围 网站开发网络工程好就业吗
  • 企业网站建设与管理试题wordpress设置页面访问权限
  • 中国顺德手机网站设计安居客做网站
  • 网站运营的含义百度地图轨迹导航
  • 网站开发时创业中文网站模板
  • 男人最爱的做网站网站建设合作合同范文
  • 我和你99谁做的网站做润滑油网站图片
  • 基于wordpress门户网站wordpress可以自己写代码吗
  • 自己做发卡网站wordpress搬家出问题
  • 网站建设数据库搭建秦皇岛市属于哪个省
  • 网站建设怎样找客户辽宁网站定制企业
  • 建设工程项目管理网站上海it公司
  • 网站运营需要 做哪些工作做网站需要了解的知识
  • 旅游去过的地方可做标识网站百度一下网页入口
  • 做ps找图的网站有哪些法与家国建设征文网站
  • 途途外贸企业网站管理系统aspnet网站模板
  • 网站建设企业网站常用参数
  • 深圳市建设工程质量检测网站网站建设公司 待遇
  • 站长工具大全php做在线直播网站
  • 品牌建设网站公司排名3d模型代做网站
  • 保定网站建设模板联系方式网站设计时图片怎么做
  • 网站策划书内容鄂尔多斯网站制作 建设
  • 广州展厅设计公司排名seo快速排名首页
  • 网站命名方式潍坊市建设工程管理处网站
  • 暴利产品竞价单页网站上海做网站建设的公司排名
  • 坪地网站建设如何做网站前端多少钱
  • 国内用不了的网站展示图片的网站模板
  • 网站优化首页付款网站制作职业
  • 做网站的软件有些什么建设公司门户网站