This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Servlets and the fly likes how to call servlet from java program Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "how to call servlet from java program" Watch "how to call servlet from java program" New topic
Author

how to call servlet from java program

nuthan kumar
Ranch Hand

Joined: Feb 14, 2006
Posts: 47
Hi,
I have a servlet which is deployed in weblogic server, I need to call this servlet from standalone JAVA program, can some one help in this and how to pass request,response parameters to servlets and taking back the response from servlet.

Thanks in advance
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56554
    
  14

A better approach would be to factor the common processing out into a separate class that can be used both by the servlet and your stand-alone app.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
nuthan kumar
Ranch Hand

Joined: Feb 14, 2006
Posts: 47
servlet is in some other server .. which we don't have any access to modify it .. requirement is i need to call that servlet by passing a XML doc object and the servlet will send the result in xml format ..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56554
    
  14

Then you could check out the URL and URLConnection classes. Or make it easy on yourself and check out HttpClient from the Jakarta project.
gopinathang nathan
Ranch Hand

Joined: Oct 28, 2006
Posts: 41
check this,


http://www.thescripts.com/forum/thread17880.html
gopinathang nathan
Ranch Hand

Joined: Oct 28, 2006
Posts: 41
Tried in weblogic, it works fine.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how to call servlet from java program
 
Similar Threads
calling core java program ffrom servlet
Java Servlets
Getting a return code from main
JOptionPane No X11 DISPLAY error
FTP Upload