美文网首页
springboot 网页显示

springboot 网页显示

作者: 萧然_fe14 | 来源:发表于2018-05-15 14:21 被阅读0次

java 使用比较多的页面是jsp 页面 内置九大对象使用起来非常方便,但是维护起来和不懂的人使用起来便是一种灾难

所以建议大家使用html    springboot 有自带的页面jar包    

配置了这个那我们就可以使用html 回显了

我们在resource 文件下面创建了一个templates 作为放html的包后面会说明为什么叫这个名字

在html 页面写入hello world       重启tomcat

此时

这个页面便会显示出来

当然页面定向也有许多方式

这就是mvc的思想先创建视图 然后根据视图名称找到对应的视图

tips:之所以是页面的包名叫templates 是因为thymeleaf 包的默认设置是templates

# Enable template caching.

spring.thymeleaf.cache=true

# Check that the templates location exists.

spring.thymeleaf.check-template-location=true

# Content-Type value.

spring.thymeleaf.content-type=text/html

# Enable MVC Thymeleaf view resolution.

spring.thymeleaf.enabled=true

# Template encoding.

spring.thymeleaf.encoding=UTF-8

# Comma-separated list of view names that should be excluded from resolution.

spring.thymeleaf.excluded-view-names=

# Template mode to be applied to templates. See also StandardTemplateModeHandlers.

spring.thymeleaf.mode=HTML5

# Prefix that gets prepended to view names when building a URL.

spring.thymeleaf.prefix=classpath:/templates/

# Suffix that gets appended to view names when building a URL.

spring.thymeleaf.suffix=.html  spring.thymeleaf.template-resolver-order=# Order of the template resolver in the chain. spring.thymeleaf.view-names= # Comma-separated list of view names that can be resolved.

相关文章

  • springboot 网页显示

    java 使用比较多的页面是jsp 页面 内置九大对象使用起来非常方便,但是维护起来和不懂的人使用起来便是一种灾难...

  • Spring中级课程第一课

    一. 创建简单工程网页SpringBoot进入[SpringBoot网站][],选择自己需要的依赖(Web,Vel...

  • 第八节 特效、选择器、过滤器

    1、特效 网页显示: 2 、基本选择器 3、层级选择器 网页显示: 4、筛选器 网页显示: 5、筛选器(conta...

  • 第九节 属性选择器、表单选择器

    1、属性选择器 网页显示: 2、表单选择器 网页显示: 3、操作css属性 网页显示: 4、操作属性 attr、r...

  • idea 几个快捷键&打开下载项目

    springboot在idea的RunDashboard如何显示出来 springboot在idea的RunDas...

  • JS篇

    打开网页让网页显示某个内容: alert("hello world"); 打开网页显示对话框可以输入内容: pro...

  • 显示网页代码

    //显示网页代码//加载资源let path = Bundle.main.path(forResource: "i...

  • iOS中WebView自动重定向问题

    问题描述:WebView中加载了一个网页,网页显示时,先显示正常网页,然后自动跳到另一个网页。经过一天的排查,终于...

  • NetBeans 8.1 Servlet 网页的编码(乱码)问题

    如果你 jsp 显示的网页编码正常,但是通过 Servlet 的 doGet 或 doPost 显示的网页编码却显...

  • UIWebView的使用

    实现5个功能1 在屏幕中显示指定的网页2 控制屏幕中的网页3 在网页中加载显示PDF,Word,和JPEG图片4 ...

网友评论

      本文标题:springboot 网页显示

      本文链接:https://www.haomeiwen.com/subject/cewedftx.html