org.apache.jasper.JasperException: Unable to compile class for JSP

SayHello.jsp

<%@ page language="java" contentType="text/html; charset=gbk"
    pageEncoding="gbk"%>
<% @ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">

<title>Say Hello</title>
</head>
<body>

<h3>Say Hello to </h3>
<s:form action="HelloWorld">
Name:<s:textfield name="name"/>
</s:form>


</body>
</html>

就这样一个jsp,一运行就出现如下异常:
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 3 in the jsp file: /SayHello.jsp
Generated servlet error:
Syntax error on token "prefix", VariableDeclaratorId expected after this token


你发现错误在哪了吗?
<% @ taglib prefix="s" uri="/struts-tags" %>

这个应该是这样的:
<%@ taglib prefix="s" uri="/struts-tags" %>

就这么一个空格折腾我半天。所以一定要认真点。

你可能感兴趣的:(apache,html,jsp,servlet,struts)