wood burning stoves 2.0*
The moose likes Servlets and the fly likes How to invoke servlet from HTML without form action. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to invoke servlet from HTML without form action." Watch "How to invoke servlet from HTML without form action." New topic
Author

How to invoke servlet from HTML without form action.

Siddhartha Azad
Greenhorn

Joined: Jan 03, 2003
Posts: 9
Hi, I need to invoke a servlet from an HTML page withoug having the user to press anything. I could use the redirect tag but I don't wanna do that since thats an additional step the user can view.
Is there a way to invoke the servlet automatically?
Thx, Sid.
Jeffrey Spaulding
Ranch Hand

Joined: Jan 15, 2004
Posts: 149
Create a fake img tag and write the Servlet's URL into the src attribute.
Set height and width to 1 and you're done.
I have a cunning plan...
Bye, J.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
piece of Javascript in the page onload event?


42
Siddhartha Azad
Greenhorn

Joined: Jan 03, 2003
Posts: 9
Yep, onload would do it. But really sweet idea Jeffrey!! Thats kinda what I was looking for since I had to avoid javascript.
Thx, Sid.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to invoke servlet from HTML without form action.
 
Similar Threads
Sending mail from servlet....
How to call a jsp from a servlet
How to call Servlet from Applet?
Invoke a POST Method....
URL and mapping to servlets