首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

一个JSP的出错!请各位帮一下呀!1

2012-01-02 
一个JSP的出错!!!请各位帮一下呀!在线等!!1%@pagecontentType text/htmlcharsetGBK %%request.set

一个JSP的出错!!!请各位帮一下呀!在线等!!1
<%@   page   contentType= "text/html;   charset=GBK "%>
<%request.setCharacterEncoding( "GB2312 ");%>
<jsp:useBean   id   = "student "   class= "untitled1.student "   scope= "session "/>
<jsp:setProperty   name= "student "   property= "* "/>
<jsp:setProperty   name= "student "   property= "age "   value= "30 "/>
<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
</head>
<body>
<%if(student.getQuery()){%> <br> //报错的是这一行!
    姓名: <jsp:setProperty   name= "student "   property= "name "/> <br>
        学号: <jsp:setProperty   name= "student "   property= "stuCode "/> <br>
            年龄: <jsp:getProperty   name= "student "   property= "age "/> <br>
                <%}%>
                <hr>
                    <p> 学生
                    </p>
                    <form   name= "javabean "   action= "jsp1.jsp "   method= "get ">
                    <input   type= "hidden "   name= "query "   value= "true ">
                        <form   name= "form1 "   method= "post "   action= " ">
                        姓名: <input   type= "text "   name= "name ">
                        </form>
                        <form   name= "form2 "   method= "post "   action= " ">
                        学号: <input   type= "text "   name= "stuCode ">
                        </form>
                        <form   name= "form3 "   method= "post "   action= " ">
                        <input   type= "submit "   name= "Submit "   value= "提交 ">
                        <input   type= "submit "   name= "Submit "   value= "取消 ">
                        </form>
                        <p> &nbsp;   </p>
</body>
</html>
报错是: "jsp1.jsp ":   cannot   find   symbol;   symbol     :   method   getQuery(),   location:   class   untitled1.student



[解决办法]
<%if(student.getQuery()){%> <br/> //报错的是这一行!
姓名: <jsp:setProperty name= "student " property= "name "/> <br/>
学号: <jsp:setProperty name= "student " property= "stuCode "/> <br/>
你给他们设置的Value呢?? 是geiproperty 吧?

热点排行