A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
URL is not a String ???
achana chan
Ranch Hand
Joined: Jul 29, 2002
Posts: 277
posted
Oct 15, 2002 14:13:00
0
Hi.
I tried to get the URL thru getCodeBase(), but got an error "cannot resolve symbol"
The following snippet compiles.
try { // <Applet codebase=javadir ... > holds the directory of the class file // ...getCodeBase() returns URL but a string is expected ! // if I add "/", it turns into a string automatically else toString // math = new RemoteMathLiteClient(getCodeBase()); //??? math = new RemoteMathLiteClient(getCodeBase() + "/"); } // end of try block
Howver I do not want the "/" there, so how do I turn it the getCodeBase() into a
string
???
toString(getCodeBase()) throws up all sorts of errors.
humanum errare est.
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
Oct 15, 2002 14:19:00
0
How about getCodeBase().toString()
Associate Instructor - Hofstra University
Amazon Top 750 reviewer
-
Blog - Unresolved References
-
Book Review Blog
achana chan
Ranch Hand
Joined: Jul 29, 2002
Posts: 277
posted
Oct 15, 2002 15:55:00
0
THX Thomas
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: URL is not a String ???
Similar Threads
getCodeBase() rules
Java 3d applet and HTML
open URL in specific frame.
applet calling Servlet
Accessing TXT file on the server
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter