晕掉,第八行看不懂哪里错了!
An error occurred at line: 8 in the jsp file: /carPage.jsp
com.wrox.cars.CarBean
cannot be resolved to a type
5:
6: <body>
7: <h2>Using a JavaBean</h2>
8: <% com.wrox.cars.CarBean myCar = new com.wrox.cars.CarBean(); %>
9: I own a <%= myCar.getMake() %> <br/>
10: <% myCar.setMake("Ferrari"); %>
11: Now I own a <%= myCar.getMake() %>
JSP页面“Using a JavaBean",打不开,不知道到底哪里错了,第八行有问题吗?
------解决方案--------------------看一下路径是某正确
com.wrox.cars.CarBean
------解决方案--------------------用JSP动作撒
<body>
<h2 >Using a JavaBean </h2 >
<jsp:useBean id="myCar" class="com.wrox.cars.CarBean" scope="page"/>
I own a<jsp:getProperty name="myCar" property="make"/>
<jsp:setProperty name="myCar" property="make" value="Ferrari"/>
Now I own a<jsp:getProperty name="myCar" property="make"/>
------解决方案--------------------他是找不 到你用的那个类,在你的web-inf下看一下,有没有编译好的class存在
------解决方案--------------------你绝对没有导包,就是你的那个CarBan所在的包
------解决方案--------------------^_^