每当我尝试运行代码时,我都会遇到此错误。我在这里做的是使用以下代码从过滤器重定向jsp页面:
getServletContext().getRequestDispatcher("/myPage.jsp").forward(request,response);
浏览器显示错误
Unable to compile class for jsp" along with the root cause "String index out of range: 0
myPage.jsp页面如下:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ page session="false"%>
<!DOCTYPE html>
<html lang="en">
<head>
<title>My page</title>
</head>
<body>
<p>My text</p>
</body>
</html>