File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes java program calling a servlet... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "java program calling a servlet..." Watch "java program calling a servlet..." New topic

java program calling a servlet...

Jack Daniel
Ranch Hand

Joined: Jun 15, 2002
Posts: 163
hi e'body,...

well, i have a question..

u know we have a j2ee project (or a webfaced J2ee project).. where i have some servlet calling some cobol/CL programs.. and all..

what i want is .. i am going to make a CL program (on AS400) call a java program.. this is not my problem..

my problem is : how can I call a Servlet from a java program , from the main(String[] a) method??? IS there a way i can call a servlet from a java program.. as of what i knew till now, i can call a HttpServlet only from a browser...

After calling the servlet, i want the servlet to respond back to the browser.. possible???

The flow: jsp - (calling) - servlet - (calling) - cobol/CL prog - (calling)
java prog, with main method - (calling) - servlet - responding back to the browser.. is this possible??

i really appreciate u guys, if u think there is a way out, to handle this..
thanks a lot ;-)
Jack Daniel
Ranch Hand

Joined: Jun 15, 2002
Posts: 163
I think i found one way, of making the java prog call a servlet..

any suggestions on this??
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Have you looked at:

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: java program calling a servlet...
jQuery in Action, 3rd edition