• Post Reply Bookmark Topic Watch Topic
  • New Topic

Undefined variable or class name

 
brian buckholz
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was just reviewing Geremy Kawaller's JSP Weekend Crash Course. There is an MVC example in section 24 that I installed using Tomcat 4.0.4. Using http://localhost:8080/mvc/buy.jsp I get:
Generated servlet error:
C:\jakarta-tomcat-4.0.4\work\Standalone\localhost\mvc\buy$jsp.java:58: Undefined variable or class name: Item
out.print( Item.getAllItemsChoice("item") );
-- buy.jsp -->
<%@ page session="true" %>
<HTML><HEAD><TITLE>Shop Til You Drop</TITLE></HEAD>
<BODY BGCOLOR=cornsilk>
<form name=shopping
action=/mvc/controller.go
method=post>
Choose one:
<%= Item.getAllItemsChoice("item") %>
<input type=hidden name=viewcmd value=A>
<input type=submit value="Add to Cart">
</form>
<form action=/mvc/controller.go method=post>
<input type=hidden name=viewcmd value=C>
<input type=submit value="Show Cart">
</form>
</BODY></HTML>
<-- end buy.jsp ----
The Item.Class is in:
.../webapps/mvc/WEB-INF/classes
Any ideas ?? Seems it doesn't find the "Item" clas.
thanks.
 
Suresh Selvaraj
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I don't see any <%@ page import="Item" %> in your JSP.
Suresh Selvaraj
 
brian buckholz
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suresh,
It works - seems I forgot a lot of the earlier examples in the book left this out. Thank you !!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!