Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

codebase property in JSP?  RSS feed

 
David Duran
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm running RMI client code in a JSP page and I cannot get it to dynamically download the _Stub class because I don't specify a codebase property from where the classes can be obtained.
When placed in a standalone Java class and run through the command line with the codebase property set, the stub is downloaded.
But when I place that code in a JSP (and make the necessary modifications of course), add the code to specify the policy file, and run it through a browser the stub can't be found (told through my Tomcat window).
Any thoughts on how to specify a codebase within a JSP file?
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sodamoon -
Please review JavaRanch's naming policy and change your name accordingly.
Thanks,
 
David Duran
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And here I thought that you had the answer to my question, hahaha.
Thanks for the heads up. The naming policy stated that if I registered with an invalid name that I'd have to re-register. I just changed my publicly displayed name in my profile, does that take care of it all or does the login name also have to match my first and last name?
... Apparently it does...
[ February 12, 2002: Message edited by: David Duran ]
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope, you're good now, David.
I don't play with JSPs much so I have no practical help to offer. Sorry.
 
David Duran
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, I guess it's not so much an issue with JSP as it is in Java. Since my JSP file basically contains nothing but Java I'm trying to find a way in Java to load a codebase property, if there is such a way.
For instance, the policy file can be loaded from the command line as well as within a Java file. I'm trying to find out if there's a way to specifiy a codebase in a Java file as you can on the command line.
I'm trying RMIClassloader.loadClass but I don't know if I'm specifying the correct class name to download. Any ideas if I should specify the implementation class or the stub class?
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahhhhhhh haaaaaa, I think I'm getting you now.
So does this mean you are not using a lookup service to find your stub?
 
David Duran
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hahaha, I don't think I know what I'm doing. I just added class loader code to my existing code because I haven't found a complete example. The following code is in a JSP, and I'm trying to load the policy file and the codebase since I can't specify either from a command line. I've left the imports out of this example as well as the catch after the try...
I'm not even sure if that setProperty line is working anymore. I thought it was working yesterday but it's giving me problems now (and I didn't even make changes, bah). Anyone see where my code might be erroneous?
In the loadClass function, I don't know what to put for the class name- the stub? implementation? Does it have to be fully qualified with it's package name?

[ February 12, 2002: Message edited by: David Duran ]
[ February 12, 2002: Message edited by: David Duran ]
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!