index.jsp文件,里面没有JSP代码,纯HTML,只是在开头标记了:
<%@ page contentType="text/html;charset=utf-8" language="java" %>
能够运行起来,但是如果我在页面中加入了一句输出的话:<%out.print("错误!")%>就运行不起来了,显示错误:
org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 61 in the jsp file: /index.jsp
Syntax error, insert ";" to complete Statement请问为何?是没有引入什么包吗?
<%@ page contentType="text/html;charset=utf-8" language="java" %>
能够运行起来,但是如果我在页面中加入了一句输出的话:<%out.print("错误!")%>就运行不起来了,显示错误:
org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 61 in the jsp file: /index.jsp
Syntax error, insert ";" to complete Statement请问为何?是没有引入什么包吗?
<%=错误!%>
你自己看错误呀 这里不是说的很明白了吗
<%=错误!%>
这东西要嵌在HTML中间 不能这样写的
<%......%>这种格式是用于直接在jsp页面中写java代码的;java代码中每条语句后面必须得有“;”;因为java语句以“;”来标志结束的。也就像汉语中使用“。”来表示这句话结束一样。