日期:2014-05-18  浏览次数:20649 次

一个快让我发狂的问题
这是我的THML内容
<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=UTF-8 ">
<title> Insert   title   here </title>
</head>
<body>
<form   method= "post "   action= "jbean_jsp.jsp ">
<pre>
<p   align= "center ">
用户名: <input   type= "text "   name= "username "   size= "20 ">

密     码: <input   type= "password "   name= "pwd "   size= "20 ">

<input   type= "submit "   value= "提交 "   name= "sb ">
</p>
</pre>
</form>
</body>
</html>
这个是我的JSP内容
<%@   page   language= "java "   contentType= "text/html;   charset=UTF-8 "
        pageEncoding= "UTF-8 "   import= "java.beans.* "   %>
  <jsp:useBean   id= "test "   class= "bean.jteat "   scope= "page ">
  </jsp:useBean>
<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=UTF-8 ">
<title> Insert   title   here </title>
</head>
<body>
<jsp:setProperty   name= "test "   property= "* "/>
username:
<jsp:getProperty   name= "test "   property= "username "/>
password:
<jsp:getProperty   name= "test "   property= "pwd "/>  
<%
out.print(test.getUsername());
%>
</body>
</html>
下面这个是我的JAVA内容
package   bean;


public   class   jteat   {
private   String   username;
private   String   pwd;
public   void   setUsername(String   username){
this.username   =   username;
}
public   String   getUsername(){
return   this.username;
}

public   String   getPwd()   {
return   pwd;
}

public   void   setPwd(String   pwd)   {
this.pwd   =   pwd;
}
}
我已经试了N多个了,他都是报这错
严重:   Servlet.service()   for   servlet   jsp   threw   exception
org.apache.jasper.JasperException:   /jdbc_jsp/jbean_jsp.jsp(3,1)   The   value   for   the   useBean   class   attribute   bean.jteat   is   invalid.
我现在都想杀人了,郁闷,也不知道哪错了,请哪位大哥帮忙解决下!!!!!!!!!!!!

------解决方案--------------------
你的程序没有任何问题,运行bean也不需要设置,建议修改jsp文件名 <form method= "post " action= "jbean_jsp.jsp "> 至 <form method= "post " action= "jbean.jsp ">