aspose file tools*
The moose likes Java in General and the fly likes Invoke servlet from java class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Invoke servlet from java class" Watch "Invoke servlet from java class" New topic
Author

Invoke servlet from java class

Sathish Ramadas
Greenhorn

Joined: Feb 18, 2004
Posts: 27
Hi,
How do you invoke a servlet from a simple java class.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Sathish,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Take a look at HttpURLConnection and URL classes. They're what you want (you may also want Runnable and Thread to avoid long waits in your program while the network connection is open).


42
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12788
    
    5
Remember that servlets are intended to run in the servlet container environment such as Tomcat, not as stand-alone programs. It is the servlet container that handles turning your HttpURLConnection into a request.
Bill
Sathish Ramadas
Greenhorn

Joined: Feb 18, 2004
Posts: 27
Thanks for the information.
 
jQuery in Action, 2nd edition
 
subject: Invoke servlet from java class