我感觉可能这儿有问题:
<jsp:useBean id="testbean" class="myBean.yangshi" scope="session" /> 
你的class指定的myBean.yangshi是个bean?只是猜测,楼主应该说明错误的原因,或是把错误贴出来。这样代码很难找错误的。呵呵

解决方案 »

  1.   

    usebean肯定出错了<%@ page contentType="text/html; charset=gb2312" language="java"  import="java.util.*"%> 
    <HTML> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">; <title>jsp教程 </title> 
    <link rel="stylesheet" type="text/css" href="styles.css" /> 
    <style type="text/css"> 
    h1{ text-decoration: none; white-space: nowrap; padding-bottom: 10px; color:#66FF66; } 
    h1:hover { background: url('http://blog.sina.com.cn/pic/4723cdbf020002nm') repeat-x 100% 100%; } 
    h5{ text-decoration: NONE; color: #6633FF;} 
    h5:hover {font-weight: bold;color: #CC00FF;} 
    </style> 
    <script language="javascript"> 
    <!-- 
        function handle(){ 
    var mousex; 
    var mousey; 
    mousex=window.event.x; 
    mousey=window.event.y; 
    keycon.style.left=mousex; 
    keycon.style.top=mousex; 

    document.onclick=handle; 
    --> 
    </script> 
    </head> 
    <BODY> 
    <link href="/styles.css" rel="stylesheet" type="text/css"> <p>&nbsp; </p> 
    <h1 align="center"> 
    jsp教程 </h1> 
    <FORM method="post" action="usebean.jsp" name="form"> 
    <h5> 
    What's your name?&nbsp; 
    <input type="text" name="Username" 
    size=20> <br> What's your e-mail address?&nbsp; &nbsp; <input type="text" name="Email" 
    SIZE="20" > <br> What's your age?&nbsp;&nbsp; <input type="password" name="Age" 
    size="4"> </h5> 
    <p> 
      <INPUT type="submit" name="submit" value="提交"> &nbsp; <input type="reset" name="reset" value="重置"> 
      </p> 
      </FORM> <br> <div ID="keycon" style="position:absolute;top:128;left:128"> 
    <img src="u=4028316861,3858036405&gp=-26.jpg"/> 
    </div> 
    </p> 
    <p>&nbsp; </p> 
    </body> 
    </html> 
    第二个为: 
    <%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*" %> 
    <% request.setCharacterEncoding("gb2312");%> 
    <HTML> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">; <title>jsp教程 </title> 
    <link rel="stylesheet" type="text/css" href="styles.css" /> 
    <style type="text/css">   
    h1{ text-decoration: none; white-space: nowrap; padding-bottom: 10px; color:#66FF66; } 
    h1:hover { background: url('http://blog.sina.com.cn/pic/4723cdbf020002nm') repeat-x 100% 100%; } 
    h5{ text-decoration: NONE; color: #6633FF;} 
    h5:hover {font-weight: bold;color: #CC00FF;}   
    </style> 
    <script language="javascript"> </script> 
    </head> 
    <BODY> 
    <link href="/styles.css" rel="stylesheet" type="text/css"> <p>&nbsp; </p> 
    <h1 align="center"> 
    jsp初级教程 </h1> 
    <h5> 
    your name is:  </h5> 
    <td> 
    <h5> 
    your age is: 
    </h5> 
    </td> <h5> <td> 
    </td> 
    <div ID="keycon" style="position:absolute;top:128;left:128"> 
    <img src="u=4028316861,3858036405&gp=-26.jpg"/> 
    </div> 
    <body> 
    </body> 
    </html>这样有输出的