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. Python3调用hessian

    领导派了个任务,实现服务器日志文件调用hessian接口保存到数据库 研究了半天python调用hessian的办法 首先使用hessian for python的链接: http://hessian ...

  2. Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ssm]]

    org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].Standard ...

  3. Codesforces 467E Alex and Complicated Task

    E. Alex and Complicated Task time limit per test 2 seconds memory limit per test 256 megabytes input ...

  4. 36.Minimum Path Sum(最小路径和)

    Level:   Medium 题目描述: Given a m x n grid filled with non-negative numbers, find a path from top left ...

  5. EventBus总结(原)

    1.EventBus的作用 EventBus is a publish/subscribe event bus for Android and Java. EventBus可以被用来在各种自定义的监听 ...

  6. 【Java学习笔记】百度面试问题回顾(一)

    今天回顾了部分百度面试时被问到的问题: 1.常见的包装类有哪些,他们与基本类型的区别,有哪些方法? Java语言是一个面向对象的语言,但是Java中的基本数据类型却是不面向对象的,这在实际使用时存在很 ...

  7. error: Error trying to parse settings: Unexpected trailing characters in Packages\User\Preferences.sublime-settings:9:2 reloading settings Packages/User/Preferences.sublime-settings

    error: Error trying to parse settings: Unexpected trailing characters in Packages\User\Preferences.s ...

  8. OpenCV常用基本处理函数(1)读写

    图像的基本操作 cv.imread()      读取图片 cv.imshow()     显示图片 cv2.imwrite()    保存图像 使用摄像头捕获实时图像 OpenCV 为这中应用提供了 ...

  9. Pycharm文档模板变量

    点击这里查看JetBrains官方英文源文件 本篇Blog只是搬运外加大概翻译一下. File template variables A file template can contain varia ...

  10. Map、Filter和Reduce函数(Python)

    Map map(function_to_apply, list_of_inputs) 设有以下代码: >>> items = [1, 2, 3, 4, 5] >>> ...