Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

importing classes into JSP page

843836Apr 6 2004 — edited Apr 13 2004
Hi There,

I am new to this and here is my problem.

I am doing a shopping cart tutorial and trying to get a JSP page to import two classes :

<%@ page language="java" contentType="text/html"
import="ShoppingBasket,Product"
errorPage="errorpage.jsp" %>

I get :

C:\jakarta-tomcat-4.1.30\work\Standalone\localhost\_\shop_0002dbasket_jsp.java:7: '.' expected
import ShoppingBasket;
^
C:\jakarta-tomcat-4.1.30\work\Standalone\localhost\_\shop_0002dbasket_jsp.java:8: '.' expected
import Product;
^
C:\jakarta-tomcat-4.1.30\work\Standalone\localhost\_\shop_0002dbasket_jsp.java:50: cannot resolve symbol
symbol : class ShoppingBasket
location: class org.apache.jsp.shop_0002dbasket_jsp
ShoppingBasket basket = null;


The classes compile ok . I read that instead of comma seperating the classes it might be better to put them in a package but I do not know the correct syntax or where to put the package if this is correct.

The tutorial is from this book and the shopping cart source code is here.

http://www.ineasysteps.com/books/?1840781971


Any help appreciated


Jim Ascroft
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 11 2004
Added on Apr 6 2004
14 comments
2,020 views