//文件 BookHotel.jsp
<jsp:useBean id='roomBooking'
scope='page'
class='beans.HotelBean'
/><jsp:setProperty name='roomBooking' property='*' /><html>
<head><title>Bean test</title></head><body>
<h2> <%=roomBooking.getName()%>
to stay for
<%= roomBooking.getnNights() %> nights. </h2>
</body>
</html>// //HotelForm.jsp
<jsp:useBean id="roomBooking" scope="page" class="beans.HotelBean" /><jsp:setProperty name="roomBooking" property="*" /><html>
<body><h3 align="center">Welcome to the Hotel California</h3><form method="POST" action="BookHotel.jsp">
<p>Name: <input type="text" name="name" size="20"></p>
<p>How many nights:
<select size="1" name="nNights">
<option selected="">1</option>
<option>2</option>
<option>3</option>
</select>
</p>
<p><input type="submit" value="Submit" name="B1"></p>
</form></body>
</html>
//javabean.package beans;public class HotelBean
{ String name;
int nNights; public String getName()
{ return name;
} public void setName(String name)
{ this.name = name;
} public int getnNights()
{ return nNights;
} public void setnNights(int nNights)
{ this.nNights = nNights;
}
}
The method getName() is undefined for the type HotelBean
9: <head><title>Bean test</title></head>
10:
11: <body>
12: <h2> <%=roomBooking.getName()%>
13: to stay for
14: <%= roomBooking.getnNights() %> nights. </h2>
15: </body>
JSPファイル: /BookHotel.jsp の中の14行目でエラーが発生しました
The method getnNights() is undefined for the type HotelBean
11: <body>
12: <h2> <%=roomBooking.getName()%>
13: to stay for
14: <%= roomBooking.getnNights() %> nights. </h2>
15: </body>
16: </html>
谁遇到过这种事啊?
我有时候是重新启动tomcat就好了。
学生登陆之后会自动获得自己在学校网络上的硬盘空间, 500M的, tomcat什么的都存在那儿。 昨天重启了几遍tomcat都不行。 今天来了一下就好了。。这到底是为什么?..