请高人帮看一下

05-10-13 qingang

请大家帮我看一下

我写了一个JSP小程序,但是在TOMCAT运行是出现了问题。

第一个是Q1.html

<HTML>

  <BODY>

  <FORM METHOD=POST ACTION="q2.jsp">

 请输入您的姓名:

  <INPUT TYPE=TEXT NAME="thename">

  <INPUT TYPE=SUBMIT value="SUBMIT">

  </FORM>

  </BODY>

  </HTML>

上面运行没有问题,但传递给q2.Jsp就出现了错误。

<HTML>

  <BODY>

  <%@page language="java" %>

  <%! String name=""; %>

  <%

  name = request.getParameter("thename");

session.setvalue("thename",name);

  %>

 您的姓名是: <%= name %>

  <p>

  <FORM METHOD=POST ACTION="q3.jsp">

 您喜欢吃什么 ?

  <INPUT TYPE=TEXT NAME="food">

  <P>

  <INPUT TYPE=SUBMIT value="SUBMIT">

  </FORM>

  </BODY>

  </HTML>

错误为

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

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

An error occurred at line: 5 in the jsp file: /q2.jsp

Generated servlet error:

Syntax error on tokens, delete these tokens

An error occurred at line: 5 in the jsp file: /q2.jsp

Generated servlet error:

Syntax error on tokens, delete these tokens

org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)

org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)

org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:409)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.11 logs.

帮忙看一下好吗

猜你喜欢