Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet to HTML

 
Revati Pathak
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u can use URL class to send html to browser..
try it
 
maateen ashraf
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic