This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes HFSJ doubts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HFSJ doubts" Watch "HFSJ doubts" New topic
Author

HFSJ doubts

hem kumar
Ranch Hand

Joined: Sep 05, 2005
Posts: 97
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


.....For Every Problem There Is a Solution.....
Regards, Hem
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

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

Joined: Dec 11, 2004
Posts: 13410

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 ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
PradeepPillai Pradeep
Ranch Hand

Joined: Nov 15, 2005
Posts: 184
I am hoping you set the classpath to
\TomcatInstallDirectory\common\lib\servlet-api.jar
hem kumar
Ranch Hand

Joined: Sep 05, 2005
Posts: 97
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

Joined: Dec 11, 2004
Posts: 13410

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

Joined: Sep 05, 2005
Posts: 97
hi BEN thank u very muh for clearing the doubt regarding the "." symbol in classpath structure.
Priyanka reddy
Greenhorn

Joined: Nov 13, 2005
Posts: 5
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

Joined: Nov 10, 2005
Posts: 77
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HFSJ doubts
 
Similar Threads
Tomcat 6 - getting started
What problem is this?
Basic Servlet Compilation Problem
problem in HFSJ chapter 3 Beer example
javac can't find package