|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Sorry for my English(I am from Russia).
I have one small question: how can I call a servlet from html page, but not reload this page? (not using frame and applet, this is a plain html page) In principle, I have answer to this question, but I want to hear more versions of solving this problem. Thank you. |
|
#2
|
|||
|
|||
|
If u r using a servletrunner, then u can call the servlet from the html like this:
If u have a form inside the html, u r form tag will look like this: <form action="http://localhost:8080/servlet/servletname" method=post> This will ensure that only post requests can be sent. So u can't reload the serlvet. |
|
#3
|
|||
|
|||
|
ajitrm, DON'T RELOAD THE PAGE!!!
|
|
#4
|
|||
|
|||
|
I don't understand what u mean by not reloading. U have written about reloading not me.
|
|
#5
|
|||
|
|||
|
Usually, when you send data on the server, then your web-page (html-page) is REFRESHED(updated, RELOAD, renew). But I want to send data on the server without REFRESHING this page.
My english is very bad! |
|
#6
|
|||
|
|||
|
Hi!
One idea is to have the <form>-tag which calls the servlet in a separate "invisible" frame, i.e <frameset cols="100%,*">, and have a JavaScript alter and submit the form when some event is triggered. This way, the shown HTML-page won't be reloaded/refreshed. (Other methods than using a form is possible with JavaScript...) Hope this helps! |
|
#7
|
|||
|
|||
|
Torakh, good idea.
Anybody else? |
|
#8
|
|||
|
|||
|
Lots of javascript options...
Do you need to be cross-browser compatible? Do you need to receive information or just send it? |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > How can I call a servlet from html page? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|