jimmy

Greenhorn
+ Follow
since Nov 06, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by jimmy

it seems some errata make things confusing especially when you test yourself with the mock test.
I know there are some being posted here, but not all of them. could someone can give a list?
ok, I got it and find the problem, thanks anyway.
OK, I got it.

The CLASSPATH environment variable must be set to point to any directories that contain Java classes that you want to import. To point to specific Java Packages, you must set the CLASSPATH to point to the directory ABOVE the package:
19 years ago
why? I think I can use relative directory here.
when I add the package structure into the code , the beerSelect.java can not find the BeerExpert and can not compile. and I noticed that the directory structure is just like page 72. why?
shall I use javac -d to create all the sub-directory below beerV1/classes/ automatically or create the structure first? (actually, as I got the compile problem, I did it in both way, but still get the same compile error with can not find com.example.model package)
and to the author, page 35, second paragraph line 2 should be an "a" not an "and" .
and by the way, do I need to declare class as public if I try to use import? and the reason I can not use new a.b.One() without import ,but I might use new java.util.Vector() without import package is the classPath is not specify the directroy of the a.b.*.class. am I right?
thank you again.
ok, now, I change all the things like:
current/src/a/b/One.java
current/src/a/c/Two.java
and I find :
current/classes/a/b/One.class --- because I can compile One.java without problem.

I changed Two.java as well which looks like :
-------------
package a.c;
import a.b.*;
class Two{
public static void main(String ar[]){
int i = newOne().get();
System.out.println(i);
}
}
-----------------
and useing follow compile :
current: javac -d classes src/a/b/One.java ---OK
current: javac -d classes src/a/c/Two.java --- still can not find a.b.One???
hi, guys, I got a problem in trying to take advantage of the java package structure. like this:
//------------
package a.b;
class One {
public int get(){return 8;}
}
//-----class Two try to use One
package a.c;
class Two{
public static void main(String ar[]){
int i = new a.b.One().get();
System.out.println(i);
}
}

and the directary is like : current/src (One.java and Two.java in this directary).
also exist current/classes

compile by useing the command like :
current : javac -d classes src/One.java
(works well and I get current/classes/a/b/One.class.)
current : javac -d classes src/Two.java
----------compile error, a.b.One package doesn't exist! ???
19 years ago
hi, guys, I got a problem in try to take advantage of the java package structure. like this:
//------------
package a.b;
class One {
public int get(){return 8;}
}
//-----class Two try to use One
package a.c;
class Two{
public static void main(String ar[]){
int i = new a.b.One().get();
System.out.println(i);
}
}

and the directary is like : current/src (One.java and Two.java in this directary).
also exist current/classes

compile by useing the command like :
current : javac -d classes src/One.java
(works well and I get current/classes/a/b/One.class.)
current : javac -d classes src/Two.java
----------compile error, a.b.One package doesn't exist! ???
you know, I just pass the programmer certification last week. it seems that I can not test jsp and servlet in the same way that I test standard java applications. as they are treat as web application and need a web server to containing and supporting it. so, I can not just put raw code files. deployment steps need to be followed.
also, I can just get an simple war file and change its setting to adapt my code then, test my code in this way, but it is not the way people work on it. am I right ?
I am not a programmer before, but I believe I like it in some way. it took me one month and a half to pass the scjp. I don't know when I can pass this one. it seems more difficult .
thank you guys, I know I can learn a lot here. your quick reply really give me confidence!!!
Thank you..
19 years ago
it seems tomcat changed a lot from version 3.0, my ebook is based on tomcat 3.0 and I can not follow the way to just put a .class file to some dir like installdir/webpages/WEB-INF/classes. and then, just use http://localhost/servlet/** to test that servlet.
as I am very new on tomcat and servlet , so, normally , how to test your servlet and jsp file in tomcat then.
I run the example and I notice the structure of a .war is quite complex in some way.
19 years ago
I compile my first servlet and try to use tomcat. but get really tired on sintalling the servlet.
I got two version tomcat : 3.4 and the latest one 5.5.4 . both server can run very well.
As my ebook using the old tomcat 3.o as the sample. I just want to know where shall I put my .class files and then I can test them by putting url like http://localhost/servlet/**
19 years ago


( tags added, tabs replaced by spaces)
[ December 07, 2004: Message edited by: Barry Gaunt ]
mike , great job, you hit the point. thanks
System.out.println("s1==s1.toLowerCase() "+s1==s1.toLowerCase() );