Hi guys! I am trying create module for online shopping! But i am getting a same error in all of my jsp pages around the first statement of my code i.e.: <%@ page language ="java" contentType="text/html" import = "ShoppingBasket,Product" errorPage="errorpage.jsp" %>
And the error is:
Java Server Page Translation Error Error during compilation : C:\Java\jws\tmpdir\default\pagecompile\jsp\_shop_semptybasket.java:14: '.' expected import ShoppingBasket; ^ C:\Java\jws\tmpdir\default\pagecompile\jsp\_shop_semptybasket.java:15: '.' expected import Product; ^ C:\Java\jws\tmpdir\default\pagecompile\jsp\_shop_semptybasket.java:75: cannot resolve symbol symbol : class ShoppingBasket location: class pagecompile.jsp._shop_semptybasket ShoppingBasket basket = null; ^ C:\Java\jws\tmpdir\default\pagecompile\jsp\_shop_semptybasket.java:78: cannot resolve symbol symbol : class ShoppingBasket location: class pagecompile.jsp._shop_semptybasket basket= (ShoppingBasket) ^ C:\Java\jws\tmpdir\default\pagecompile\jsp\_shop_semptybasket.java:83: cannot resolve symbol symbol : class ShoppingBasket location: class pagecompile.jsp._shop_semptybasket basket = (ShoppingBasket) Beans.instantiate(getClassLoader(), "ShoppingBasket"); ^ 5 errors
Please help me out since I write the above code line from one of the jsp books still i am getting error. Thanks for the Help in Advance!
Hi Ben! According to your advice I packaged my bean in a package called shop, But now i got a new error as: Error during JSP page processing javax.servlet.ServletException: Cannot create bean of class ShoppingBasket at pagecompile.jsp._shop_sbasket._jspService(_shop_sbasket.java:86)
Well I am very very sorry for taking your precious time. Actully your second reply was more than enough to solve my problem. Actully i created the package but I forgot to change the ShoppingBasket name in my useBean tag to shop.ShoppingBasket i.e. <jsp:useBean id="basket" class=[B]"shop.ShoppingBasket"[B] scope="session" />
Anyway thank you Very much for you grate grate help