wood burning stoves*
The moose likes Applets and the fly likes Applet to HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet to HTML" Watch "Applet to HTML" New topic
Author

Applet to HTML

Revati Pathak
Greenhorn

Joined: Feb 19, 2001
Posts: 26
I want to pass a value from an applet to the HTML page (which contains the applet) .This should happen on click event of a button in the applet.
maateen ashraf
Ranch Hand

Joined: Jan 08, 2001
Posts: 122
just run a servlet on server side from where the applet has been loaded to client machine
now pass this value to servlet by response object.
Revati Pathak
Greenhorn

Joined: Feb 19, 2001
Posts: 26
hi,
i know i can easily do it using servlets but i don't want to use servlet.
regards,
-Revati
Originally posted by maateen ashraf:
just run a servlet on server side from where the applet has been loaded to client machine
now pass this value to servlet by response object.

Rahul Rathore
Ranch Hand

Joined: Sep 30, 2000
Posts: 324
Sorry for my ignorance, but I could not understand the question. What do you mean by passing a value from an applet to the HTML page containing it?? Can you be more specific? What value you want to pass, to what object? Do you want the HTML page to change- how, what, when??
Ramneek Handa
Ranch Hand

Joined: Nov 10, 2000
Posts: 44
Hi! Maateen
sorry i did not get what you what to tell.
how can we pass a value to a servlet through response object. i believe we can pass a value only through request only.
and even then how can we pass it to the html which is running that applet which is calling the servlet.
pls explain
maateen ashraf
Ranch Hand

Joined: Jan 08, 2001
Posts: 122
u can use URL class to send html to browser..
try it
maateen ashraf
Ranch Hand

Joined: Jan 08, 2001
Posts: 122
hi Ramneek Handa
u will use request object to send values to servlet
&
use response object to pass it to browser
Rahul Rathore
Ranch Hand

Joined: Sep 30, 2000
Posts: 324
Hi mateen
If we send a response using response object, it will send a new HTML page [B] to the browser. But the Revati's original question is - how to pass values from the applet, to HTML page [B] containing the applet. I could not understand
Originally posted by maateen ashraf:
hi Ramneek Handa
u will use request object to send values to servlet
&
use response object to pass it to browser

anuj khanna
Greenhorn

Joined: Jan 11, 2001
Posts: 20
hi,
i'm not sure how to pass the value from the applet to the web-page but don't u think if u're able to pass a value to the HTML page u're actually making a dynamic page from an applet ,and i suppose a servlet is supposed to do this,generate a dynamic page
Sarath Mohan
Ranch Hand

Joined: Mar 17, 2001
Posts: 213
Hi,
Try this:
AppletContext ac = getAppletContext();
ac.showDoucumet(new URL("your htmlpage with this applet"?partameters, "_SAME"));
Check the second parameter in the URL constructor for correctness
OK

Sarath Mohan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet to HTML