Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

error class not found

 
bibin sk
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sir
ihave created a class in directory named onlineshop called BooksDeatils for adding items to cart and in servlet named ShowCartServlet
ihave called this class as
// public class ShowCartServlet extends HttpServlet
{
public BooksDetails cart;
private HttpSession session;

public void doPost (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
session = request.getSession(true);
cart = (BooksDetails) session.getValue(session.getId());//
but error is coming as CLASS ONLINESHOP.BOOKSdEATILS NOT FOUND IN ShowCartServlet .PLEASE TELL ME HOW TO GET RID OF THIS ERROR.
 
Shripad Bokil
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Please make sure that you have an import statement ...
import ONLINESHOP.BOOKSdEATILS at the start of your code.
The error you are getting is nothing but the compiler is not getting that perticular class.If you have imported it already then set the classpath properly.
This should solve your problem.
 
I child proofed my house but they still get in. Distract them with this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!