FAQs
Search
Recent Topics
Flagged Topics
Hot Topics
Best Topics
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Liutauras Vilda
Bear Bibeault
Devaka Cooray
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Campbell Ritchie
Henry Wong
Saloon Keepers:
Tim Moores
Ron McLeod
salvin francis
Stephan van Hulst
Vijitha Kumara
Bartenders:
Tim Holloway
Carey Brown
Frits Walraven
Forum:
HTML Pages with CSS and JavaScript
how to call servlet from javascript without using form
krunal prajapati
Greenhorn
Posts: 19
I like...
posted 6 years ago
hello,
I want to call
servlet
from
javascript
and my index.jsp is
<html> <head> <script type="text/javascript"> function callservlet(){ document.location.href="servlet/mainDAO"; //document.getElementById().src="mainDAO"; } </script> </head> <body> <a onclick="javascript callservlet();"></a> </body> </html>
I tried both javascript method
and my servlet class is mainDAO.java is
in doGet method
PrintWriter out = rwsponse.getWriter(); out.println("hello world");
then how can I call servlet without using form ans submit button
thanks,
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66484
160
I like...
posted 6 years ago
It's not clear what your issue is. Please be more explicit.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Post Reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Checking file size before uploading
not able to call javascript function
Href with onClick
JSP code not working properly
Java script functions in Servlet Output
More...