Spring Boot with JSP and Tiles3
Spring Boot with JSP and Tiles3
Using tiles and jsp on a Spring Boot 1.2.7 project
file: pom.xml
under <project>
<packaging>war</packaging>
under <properties>
<main.basedir>${basedir}/../..</main.basedir>
<m2eclipse.wtp.contextRoot>/</m2eclipse.wtp.contextRoot>
under <dependencies>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
</dependency>
file: application.properties
spring.view.prefix= /WEB-INF/jsp/
spring.view.suffix: .jsp
JSP and Tiles files location
src/main/webapp/WEB-INF/jsp/
src/main/webapp/WEB-INF/tiles/
Tiles configuration
create a new file your.package.config.ConfigurationForTiles
package your.package.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.tiles3.TilesConfigurer;
import org.springframework.web.servlet.view.tiles3.TilesView;
import org.springframework.web.servlet.view.tiles3.TilesViewResolver;
@Configuration
public class ConfigurationForTiles {
@Bean
public TilesConfigurer tilesConfigurer() {
final TilesConfigurer configurer = new TilesConfigurer();
configurer.setDefinitions(new String[] { "WEB-INF/tiles/tiles.xml" });
configurer.setCheckRefresh(true);
return configurer;
}
@Bean
public TilesViewResolver tilesViewResolver() {
final TilesViewResolver resolver = new TilesViewResolver();
resolver.setViewClass(TilesView.class);
return resolver;
}
}
https://gist.github.com/eleclerc/9deef1f4a73295768889
Spring Boot with JSP and Tiles3的更多相关文章
- spring boot整合jsp的那些坑(spring boot 学习笔记之三)
Spring Boot 整合 Jsp 步骤: 1.新建一个spring boot项目 2.修改pom文件 <dependency> <groupId>or ...
- spring boot: 支持jsp,支持freemarker
spring boot: 支持jsp,支持freemarker 支持jsp: 加入依赖 <!--jsp--> <dependency> <groupId>org.a ...
- Spring boot整合jsp
这几天在集中学习Spring boot+Shiro框架,因为之前view层用jsp比较多,所以想在spring boot中配置jsp,但是spring boot官方不推荐使用jsp,因为jsp相对于一 ...
- Spring Boot 添加JSP支持【转】
Spring Boot 添加JSP支持 大体步骤: (1) 创建Maven web project: (2) 在pom.xml文件添加依赖: (3) ...
- 81. Spring Boot集成JSP疑问【从零开始学Spring Boot】
[原创文章,转载请注明出处] 针对文章: ()Spring Boot 添加JSP支持[从零开始学Spring Boot] 有网友提了这么一些疑问: 1.Spring Boot使用jsp时,仍旧可以打成 ...
- (19)Spring Boot 添加JSP支持【从零开始学Spring Boot】
[来也匆匆,去也匆匆,在此留下您的脚印吧,转发点赞评论: 您的认可是我最大的动力,感谢您的支持] 看完本文章您可能会有些疑问,可以查看之后的一篇博客: 81. Spring Boot集成JSP疑问[从 ...
- spring boot集成jsp
我们在使用spring boot进行web项目开发的时候,可能会选择页面用jsp.spring boot默认使用的html的,现在我们来看下如何集成jsp页面进行开发. 1.pom.xml文件引入所需 ...
- 从零开始的Spring Boot(4、Spring Boot整合JSP和Freemarker)
Spring Boot整合JSP和Freemarker 写在前面 从零开始的Spring Boot(3.Spring Boot静态资源和文件上传) https://www.cnblogs.com/ga ...
- spring boot 访问jsp 弹出下载
在pom.xml中加入以下jar 包 <!-- 引入Spring Boot 内嵌的Tomcat对jsp的解析包--><dependency> <groupId>or ...
随机推荐
- 加固linux
http://linoxide.com/linux-command/password-aging-secure-linux-access/
- Android中CursorLoader的使用、原理及注意事项
前言 最近在项目中涉及到了即时聊天,因此不可避免地要用到实时刷新的功能,因为在以前的项目中见到别人使用CursorLoader+CursorAdapter+ContentProvider的机制来实现实 ...
- 9.10 Binder系统_Java实现_hello服务
怎么做?2.1 定义接口: 写IHelloService.aidl文件, 上传, 编译, 得到IHelloService.java 里面有Stub : onTransact, 它会分辨收到数据然后调用 ...
- 点滴记录——学习Redis笔记
转载请说明出处:http://blog.csdn.net/cywosp/article/details/39701409 Redis 默认port6379 Redis适用场景 1. 取最新N个数据的操 ...
- -bash: /usr/local/mysql/scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file or directory
安装 MySQL 初始化时,报错如下: [root@hcdb1 ~]# /usr/local/mysql/scripts/mysql_install_db --defaults-file=/etc/m ...
- 几款用jQuery写的h5小游戏
人人都说前端用来做游戏是一件很困难的事情,遇到这些js的逻辑性问题,是不是有点懵?其实,做完一款游戏之后就会发现,没啥难的地方,差不多都是换汤不换药,作为爱玩游戏的我,也总结收集了几款比较流行的小软件 ...
- 黑马程序猿——15,String,StringBuffer,基本数据类型包装对象
------<ahref="http://www.itheima.com" target="blank">Java培训.Android培训.iOS培 ...
- C语言实现字符串截取函数left、mid和right
作者:iamlaosong C语言字符串截取须要自己编程实现,只是.网络时代,自然不用自己从头写了.网上各种方法的实现代码已经多如牛毛了,这儿抄录一个感觉不错的备案. #include <std ...
- 慎重Asp.net中static变量的使用方法
在.Net平台下进行CS软件开发时,我们常常遇到以后还要用到某些变量上次改动后的值,为了简单起见,非常多人都习惯用static来定义这些变量,我也是.这样非常方便.下一次调用某个函数时该变量仍然保存的 ...
- 学习Numpy基础操作
# coding:utf-8 import numpy as np from numpy.linalg import * def day1(): ''' ndarray :return: ''' ls ...