Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ doubts

 
hem kumar
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all , i'm trying the HFSJ mini mvc application.i have made the appropriate directory structure in my system as is specified there. But when i tried to compile the BeerSelect.java servlet file given in page 84 , the comipler giving error like package com/example/model doesnt exist, though it is very much there.i'm using jdk1.5 with Tomcat 5.0.Thats why i'm also compiling the BeerExpert.java file with javac -source 1.4 format.I'm not getting any error there but not able to compile the BeerSelect.java servlet file.. Anybody Plz sort it out.. I'm getting tension....


Life is full of trouble
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to give us a better idea of how your directories are structured, where you execute the command and what command you execute.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your classpath is not set up correctly.
See: http://faq.javaranch.com/view?CompilingServlets
for help with classpaths.
[ November 18, 2005: Message edited by: Ben Souther ]
 
PradeepPillai Pradeep
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am hoping you set the classpath to
\TomcatInstallDirectory\common\lib\servlet-api.jar
 
hem kumar
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank u all forthe advice. Now the program is running correctly but only after i set classpath to point to the directory structure where classes are there. But my doubt is why the JVM didnt get the classes from the current directory.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by mohan anand:
But my doubt is why the JVM didnt get the classes from the current
directory.


It only looks in the current directory if the current directory is on the classpath.


The dot is the symbol for "this directory".
 
hem kumar
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi BEN thank u very muh for clearing the doubt regarding the "." symbol in classpath structure.
 
Priyanka reddy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mohan,

I am planning to buy a good book on servlets and java.How much do rate Head First servlats and Jsps.Is it a good book.

with regards
priyanka
 
Chidanand Chauhan
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

HFSJ is one of the best book ever i read regarding Servlet and JSP.
It clears every step what the book has written.

Cheers and Enjoy
Chidanand Chauhan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic