我编写的
countBean.htm:
<!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=gb2312"> <title>countBean</title> </head>
<body><center> <form method="get" action="countBean.jsp"> <p>欢迎光临本站!</p> <p>请登入使用者名称: <input type="text" name="txtName"> </p> <p> <input type="submit" name="确定"> </p></form> </center> </body> </html> countBean.jsp:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %> <jsp:useBean id="counter" class="Ch12.count" scope="application"> <%@ page contentType="text/html";charset=gb2312"%> <jsp:setProperty name="counter" property="count" value="0"></jsp:setProperty></jsp:useBean> <!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=gb2312">
</head>
<body> <center> <% String userName=request.getParameter("txtName"); out.print("<center>"); out.print("<h1>Hello!"+userName+"</h1>"+"<br>"); out.print("您是第 "+count.getCount()+"光临本站的人"); out.print("<center>");
%></center>
</body> </html>
count.java:
package Ch12;
public class count { private int count; public count(){} public void setCount(int count) { this.count=count; } public int getCount() { return ++count; } }
count.java 编译完放到 G:\tomcat5.0\webapps\ROOT\WEB-INF\classes\Ch12
countBean.htm 和countBean.jsp放到G:\tomcat5.0\webapps\ROOT\myJSP.jsp中
countBean.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: /myJSP.jsp/countBean.jsp(3,0) Unterminated <%@ page tag org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:134) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:511) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539) org.apache.jasper.compiler.Parser.parseBody(Parser.java:1789) org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1060) org.apache.jasper.compiler.Parser.parseUseBean(Parser.java:1010) org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1231) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1559) org.apache.jasper.compiler.Parser.parse(Parser.java:126) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220) org.apache.jasper.compiler.ParserController.parse(ParserController.java:101) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203) org.apache.jasper.compiler.Compiler.compile(Compiler.java:470) org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.27 logs.
的错误界面 是不是我的.class文件 放的不对 还是配置不对啊
如果没有javaBean 加入 转道另一个jsp页面都没问题 这是怎么回事啊?
qq:272596865
如何联系都行啊