This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 12761
    
    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.
 
 
subject: Invoke servlet from java class
 
Similar Threads
Invoking another java program from a servlet?
Invoking a Servlet
Web Client and Swing Client distinction - Preferred pattern
call servlet from simple java file.
Invoking another java program ?