1,在idea中新建jsp文件

首先需要在springboot项目 在src 中webapp /WEB-INF/JSP

当我右键想新建一个jsp文件时默认没有

File->Project Struction ->modules 按加号 新增web,双击web resource directory 修改路径 web resource directory path为 当前项目目录/src/webapp ->WEB-INF->JSP

ok

创建jsp文件

2,jsp报错

Servlet.service() for servlet [jsp] threw exception
org.apache.jasper.JasperException: /WEB-INF/jsp/userList.jsp (line: [22], column: [4]) According to TLD or attribute directive in tag file, attribute [items] does not accept any expressions

本人jsp代码

 <%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Title</title>
</head>
<body>
<table border="1" align="center" width="50%">
<tr>
<th>ID</th>
<th>name</th>
<th>age</th>
</tr>
<c:forEach items="${list}" var="user">
<tr>
<td>${user.id}</td>
<td>${user.name}</td>
<td>${user.age}</td>
</tr>
</c:forEach>
</table> </body>
</html>

maven依赖

<!-- JSP标准标签库(JSTL)是一个JSP标签集合,它封装了JSP应用的通用核心功能。 -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>

查看http://java.sun.com/jstl/core

jstl存在1.0和1.1的差异问题,用EL建议需要在1.1以上版本:

使用jstl1.1 

只要将u'serList.jsp文件中

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
换成:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

或者也可以
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
改为
<%@ taglib uri=http://java.sun.com/jstl/core_rt prefix="c"%>

可能是因为使用了JSP2.0版本, 同时又没有使用JSTL core库的备用版本(RT库)

JSTL core库的有两种taglib伪指令, 其中RT库即是依赖于JSP传统的请求时属性值, 而不是依赖于EL来实现(称为EL库.JSP2.0将支持EL)

springboot整合jsp 遇到的问题的更多相关文章

  1. SpringBoot整合Jsp和Thymeleaf (附工程)

    前言 本篇文章主要讲述SpringBoot整合Jsp以及SpringBoot整合Thymeleaf,实现一个简单的用户增删改查示例工程.事先说明,有三个项目,两个是单独整合的,一个是将它们整合在一起的 ...

  2. 03-01:springboot 整合jsp

    1.修改pom文件,添加坐标 <!-- jstl -->        <dependency>            <groupId>javax.servlet ...

  3. springboot整合jsp模板

    springboot整合jsp模板 在使用springboot框架里使用jsp的时候,页面模板使用jsp在pom.xnl中需要引入相关的依赖,否则在controller中无法返回到指定页面 〇.搭建s ...

  4. SpringBoot整合jsp技术

    1.修改pom.xml文件 <?xml version="1.0" encoding="UTF-8"?> <project xmlns=&qu ...

  5. Idea中SpringBoot整合JSP

    最近在学习SpringBoot,看到SpringBoot整合jsp,顺带记录一下. 1.创建一个SpringBoot项目 点击Next 注意:packaging选中War,点击Next Webà选中W ...

  6. 【SpringBoot】08.SpringBoot整合jsp

    SpringBoot整合jsp 1.修改pom文件加入两个坐标jstl标签库和jasper <project xmlns="http://maven.apache.org/POM/4. ...

  7. springboot整合jsp,完成公交车站路线图

    转: springboot整合jsp,完成公交车站路线图 点赞再看,养成习惯 开发环境: jdk 8 intellij idea tomcat 8 mysql 5.7 maven 3.6 所用技术: ...

  8. 1、SpringBoot整合之SpringBoot整合JSP

    SpringBoot整合JSP 一.创建SpringBoot项目,仅选择Web模块即可 二.在POM文件中添加依赖 <!-- 添加servlet依赖模块 --> <dependenc ...

  9. springboot整合jsp报错

    今天在学springboot整合jsp时遇到了一个问题,虽然jsp不被spring官方推荐使用,但抱着学习的心态还是想解决一下这个问题.在写好了需要pom文件之后,访问网站得到了500的错误提示,后台 ...

  10. springboot整合JSP以及发布项目到独立的tomcat中与打成jar包使用

    之前研究了springboot整合freemarker与thymeleaf的使用.也研究了springboot发布到独立的tomcat的使用以及使用自带的tomcat打成jar包的使用,下面研究集成J ...

随机推荐

  1. 从vue的组件传值着手浅谈观察者模式

    首先,提到观察者模式,这不禁让我想到了MVVM,MVVM架构模式感觉用到了观察者的思想. 我们还是按照惯例,了解一下什么是观察者模式 观察者模式,类似发布订阅模式,完成这个动作首先最少得有两个不同的对 ...

  2. 【最新】 ELK之 logstash 同步数据库数据到Elasticsearch

    cd /usr/local 下载logstash 6.4.3版本 wget https://artifacts.elastic.co/downloads/logstash/logstash-6.4.3 ...

  3. linux随笔-02

    部署虚拟环境安装linux系统以及一些常用命令 工具: VmwareWorkStation  12.0——虚拟机软件(必需) RedHatEnterpriseLinux [RHEL]7.0——红帽操作 ...

  4. SpringMvc返回给前端数据@ResponseBody响应体【支持Ajax】

    1).在Controller中写 //@ResponseBody响应体是jackson包提供的 用于将Controller的方法返回的对象,通过HttpMessageConverter接口转换为指定格 ...

  5. 禁用ubuntu启用虚拟内存swap

    一.不重启电脑,禁用启用swap,立刻生效 # 禁用命令 sudo swapoff -a # 启用命令 sudo swapon -a # 查看交换分区的状态 sudo free -m 二.重新启动电脑 ...

  6. shell读取文件第一行和最后一行,小数的运算比较

    1. 读取文件的第一行:head -n +1 file.txt 读取文件的最后一行: tail -n -1 file.txt echo 12:30:55 | cut -d: -f 1 结果为12,意思 ...

  7. Mybatis基于XML配置SQL映射器(一)

    Durid和Mybatis开发环境搭建 SpringBoot搭建基于Spring+SpringMvc+Mybatis的REST服务(http://www.cnblogs.com/nbfujx/p/76 ...

  8. bzoj 2013

    http://www.lydsy.com/JudgeOnline/problem.php?id=2013 最初看这个题的时候,以为神题不可做,然后去找yzjc..然后做法过于简单了(' '       ...

  9. apue 第10章 信号signal

    每种信号都有名字,都是以SIG开头 信号机制最简单的接口是signal函数 #include <signal.h> typedef void (*sighandler_t)(int); s ...

  10. px4::init_once();和px4::init(argc, argv, "px4");函数学习

    px4::init_once(); void init_once() { _shell_task_id = pthread_self();                                ...