test1.jsp^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="test1" scope="request" class="com.xh1.test1">
<jsp:setProperty name="test1" property="*" />
</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">
<title>无标题文档</title>
</head>
<body>
<%
out.println(test1.getUsername()+"与"+test1.getPassword());
%>
<form name="form1" method="post" action="?">
<table width="100%" border="1" cellspacing="0" cellpadding="3">
<tr>
<td>用户名</td>
<td><input name="username" type="text" id="username"></td>
</tr>
<tr>
<td>密码</td>
<td><input name="password" type="text" id="password"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="Submit" value="提交"></td>
</tr>
</table>
</form>
</body>
</html>
test1.java^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
package com.ch1;
public class test1
{
private String username;
private String password;
public void setUsername(String username)
{
this.username=username;
}
public void setPassword(String password)
{
this.password=password;
}
public String getUsername()
{
return this.username;
}
public String getPassword()
{
return this.password;
}
}
高手看下是什么问题,JBuilder编绎正常,访问http://localhost:8080/xh1/test1.jsp出现以下错误^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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: -1 in the jsp file: null Generated servlet error: [javac] Since fork is true, ignoring compiler setting. [javac] Compiling 1 source file [javac] Since fork is true, ignoring compiler setting. [javac] C:\Tomcat\work\Standalone\localhost\_\xh1\test1_jsp.java:43: package com.xh1 does not exist [javac] com.xh1.test1 test1 = null; [javac] ^ [javac] C:\Tomcat\work\Standalone\localhost\_\xh1\test1_jsp.java:45: package com.xh1 does not exist [javac] test1 = (com.xh1.test1) pageContext.getAttribute("test1", PageContext.REQUEST_SCOPE); [javac] ^ [javac] C:\Tomcat\work\Standalone\localhost\_\xh1\test1_jsp.java:48: package com.xh1 does not exist [javac] test1 = (com.xh1.test1) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "com.xh1.test1"); [javac] ^ [javac] 3 errors
[此贴子已经被作者于2006-5-20 14:33:30编辑过]