wood burning stoves 2.0*
The moose likes Servlets and the fly likes how to call servlet from java program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
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: 61450
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by 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: 61450
    
  67

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://aspose.com/file-tools
 
subject: how to call servlet from java program