相关疑难解决方法(0)

JSP文件无法在Spring Boot Web应用程序中呈现

我使用嵌入式Tomcat(默认)启动并运行Spring Boot Web应用程序.当它提供JSP文件作为渲染我在控制器中指定的视图的一部分时,JSP不会这样呈现,而是打印出内容.例如:

的index.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="en">
    <head></head>
    <body>Test</body>
</html>
Run Code Online (Sandbox Code Playgroud)

在浏览器中呈现视图时,将显示上面的内容,而不是预期的内容:

Test
Run Code Online (Sandbox Code Playgroud)

spring-boot

57
推荐指数
8
解决办法
7万
查看次数

org.apache.jasper.JasperException:绝对的uri:http://java.sun.com/jsp/jstl/core无法解析

org.apache.jasper.JasperException:绝对uri:http://java.sun.com/jsp/jstl/core无法在web.xml或使用此应用程序部署的jar文件中解析

当我运行我的应用程序时,我收到此错误.

这是我的userForm.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
.even {
    background-color: silver;
}
</style>
<title>Registration Page</title>
</head>
<body>

<form:form action="add.htm" commandName="user">
    <table>
        <tr>
            <td>User Name :</td>
            <td><form:input path="name" /></td>
        </tr>
        <tr>
            <td>Password :</td>
            <td><form:password path="password" /></td>
        </tr>
        <tr>
            <td>Gender :</td>
            <td><form:radiobutton path="gender" value="M" label="M" /> <form:radiobutton
                path="gender" value="F" label="F" /></td>
        </tr>
        <tr>
            <td>Country :</td>
            <td><form:select …
Run Code Online (Sandbox Code Playgroud)

java jsp jstl

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

java ×1

jsp ×1

jstl ×1

spring-boot ×1