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

一个简单的页面,看看什么地方出错误了啊
Bean:
package   ch06;

public   class   SampleBean   {
       
        /**   Creates   a   new   instance   of   SampleBean   */
        public   SampleBean()   {
        }
        public   void   setID(String   id){
                        this.id=id;
        }
        public   void   setAge(String   age){
                this.age=age;
        }
        public   String   getID(){
                return   id;
        }
        public   String   getAge(){
                return   age;
        }
        private   String   age= "123 ";
        private   String   id= "45 ";
}
===================================================================
html:
<html>
        <head>
                <title> 一个简单的Bean程序 </title>
        </head>
        <body   bgcolor= "lightyellow ">
                <center>
                        <form   action= "sample1.jsp "   method= "post "   name= "form1 ">
                                编号: <input   type= "text "   name= "id "   > <p>
                                年龄: <input   type= "text "   name= "age "> <p>
                                <input   type= "submit "   name= "submit1 "   value= "提交 ">
                                <input   type= "reset "   name= "submit2 "   value= "重写 ">
                        </form>
                </center>
        </body>
</html>
======================================================================
jsp:
<%@   page   contentType= "text/html;charset=gb2312 "   language= "java "%>
<jsp:useBean   id= "smpBean "   class= "ch06.SampleBean "/>
<html>
        <head>
                <title> 一个简单的Bean页面 </title>
      &nb