Jimmy Hu

Greenhorn
+ Follow
since Feb 05, 2001
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 Hu

Michael,
Thanks for your help.
Looks like my knowledge on RMI is very limited -- only from Sun's RMI tutorial.
I need to read more .
In the server side of RMI, you create a remote object and then use "Naming.rebind(...)" to publish the remote object. When you create the remote object, "rebind" doesn't happen yet. How do you get some parameters from client side to create the remote object?
E.g. I need the database information to create a a Data object in server side.
Looking forward to your response.
Thanks
Jimmy
This is related to the assignment. But I am trying to address it in more general way.
RMI object created in server side cannot take any parameters from client side. What I can think of is to create a member method to take the parameters from client and change the original constructor to do nothing signicant but create a RMI object. The side effect is this imposes some order of executing the member methods of remote object. Do you know the better way to handle it?
Thanks
Jimmy
I can see your way works.
Is there an elegant way?
I appreciate your quick response.
Thanks
Jimmy
Hi,
I have this question based on my SCJD work.
If in the remote interface, some return type and parameter type refer to some class definition in server side, what is the proper way to handle it in client side?
My instinct tells me it is not a good practice to provide the duplicate class definition in client side in order to make the interface in client side compilable.
Thanks in advance
---
Jimmy
Hi,
I found a way of using javascript to open new HTML page
from JSP or html:

<script language="JavaScript" >
win = window.open();
win.document.open();
win.document.write("<p><Thank you for purchase:</p> ");
win.document.close();
</script>
Is this the only way to do that? The ideal way I can imagine
is to use JSP to pops up a new HTML and this new HTML can
inherit the same <jsp:useBean ...> instance from the parent.
I don't know whether or not it is possible.
regards
Jimmy
18 years ago
Hi,
Could you please tell me how to pops up a HTML page in a new
browser frame from a JSP/bean? Therefore there two html pages
in different frame after a JSP 's execution.
Thanks
Jimmy
18 years ago
Cindy's idea didn't work.
I even tried to modify the classpath in the run time by looking
at the current directory's jar entry. It didn't work either.
Peter's idea is a good one. I haven't tried any J2EE application
server yet.
Thanks
Jimmy
18 years ago
Thanks.
It sounds like a good idea. I will try it.
Jimmy
18 years ago
It's good idea. I will try it.
Thanks
Jimmy
18 years ago
How do you access the class in a JAR file dynamically?
Different JAR files are constantly added to the current
directory. This means the classpath is changing.
I tried System.setProperty() to set classpath and using
ClassLoader and It did't work.
Do you have any solution?
Thanks
Jimmy
18 years ago
As you know, from command line, you can do like
java -classpath c:\myapp\my.jar;. test
to run the application "test" which will access the class
in c:\myapp\my.jar
But I want to acess any class in a new jar files added to this current directory without stopping the application.
I tried to use System.setProperty("java.class.path","....")
to update the classpath after I get the jar file name using File.list(). The property -"java.class.path" - was set correctly. But I failed to do "Class.forName(...)" for the
class name in the jar file.
It looks like that SETTING classpath on fly doesn't help me
to access the class in JAR.
I tried ClassLoader as well - no help.
Could anyone tell me it is possible to do this or how to do this?

Thanks for your kind help.
Jimmy
18 years ago
As we know, Class c = Class.forName("abc") can be used to get class object for class abc in the current directory.
But if the class file is contained in a JAR file in the current
directory. How can I get the class object for the class whose
class file is inside this Jar file?
Thanks.
Jimmy
18 years ago
Ashwin,
Thanks a lot. I will try it.
------------------
Jimmy
18 years ago
Hi,
I'm new on JSP and Servlet.
One servlet generated an object and put it in ServletContext by
: getServletContext().getAttribute("examples.myObject");
Now a JSP wants to access this object(reference) and get some
internal data of this object.
How do I implement this?
Thanks for your kind help.
Jimmy
------------------
Jimmy
18 years ago