File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes hypothetical of course... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "hypothetical of course..." Watch "hypothetical of course..." New topic

hypothetical of course...

ryan headley
Ranch Hand

Joined: Jun 28, 2000
Posts: 156
I was goofing around yesterday and being the newbie that I am...barely i year java...I thought, "I wonder if I can have a JSP open up a JFrame on a client machine". Then I thought, "I'll bet I can..." so I started messing around.
I did get a window to open, but it opened on the server. How do I get it to open on the client. I figure I needed to do something with opening a socket, etc which I have working somewhat. (I can retrieve the clients IP address and the port on the server to which it is connected, and another port number, getLocalPort from ServerSocket I think....
How do I get a socket open from Server to client to pass the JFrame down, moreover, how do I pass that JFrame to the client....

Ryan Headley<br /><a href="" target="_blank" rel="nofollow"></a>
Anoop Krishnan
Ranch Hand

Joined: May 03, 2001
Posts: 163
Hai ryan,
If you want to show a JFrame on to the client i think it is possible only through an Applet(Very important is the browser in which this applet is running should have the plugins for Swings or you can have an AWT Frame and also use jsp lugin tag)
Once it is ok you can just create a JFrame in any of applet lifecycle methods (eg paint)
And i am sorry to inform you that including any of the containers in an applet is not appreciated.

[This message has been edited by Anoop Krishnan (edited May 15, 2001).]

I just want to know is there any body call my bean's Getter and Setter methods with "Please" in front - My favorite quip from Bugzilla
Jayson Falkner
Ranch Hand

Joined: May 07, 2001
Posts: 57
Hi Ryan,
Don't get confused about what a JavaServer Page is. JSP runs on the server to handle a request and generate a response for a client. Applets can run on the client-side through a browser. The two are seperate and distinctly different.
What you can do is have the HTML generated by your JSP use an Applet. This applet can then open a JFrame and continue as you like. The code for the applet in this case would be completely seperate from your JSP.
Jayson Falkner
V.P./CTO, Amberjack Software LLC

Jayson Falkner<br /><br />Author of <a href="" target="_blank" rel="nofollow">Servlets and JavaServer Pages; the J2EE Web Tier</a>
I agree. Here's the link:
subject: hypothetical of course...
It's not a secret anymore!