How to: call a Servlet within a java class

M

Marco

Hi to all!

I have an Apache Tomcat 5.0.19 Server installed on a machine in my network
(ip address: 192.168.0.211, port 8080)

I've a Servlet running on it. FileUploadServlet uses "FileUpload package" from
Apache Jakarta Project (see: http://jakarta.apache.org/commons/fileupload/), in
order to implement Upload services

I'm able to call this Servlet from a jsp test page: FileUploadServletTest.jsp
is on 192.168.0.211 and I can call it from any machine in my network, calling
http://192.168.0.211:8080/UploadTest/FileUploadServletTest.jsp

The Servlet works fine!

Now: I want to call this Servlet from a java class. This class is called
UploadStockFile.java and is part of a standalone Swing-based java program.
This program is running on a machine in my network (ip: 192.168.0.112)

How can I do this? How can I call this servlet from a java class?

Any idea greatly appreciated

Thanks and sorry for bad english ;)

Bye

Marco
 
T

Tony Morris

How can I do this? How can I call this servlet from a java class?
Any idea greatly appreciated

Thanks and sorry for bad english ;)

Bye

Marco


Have a look at java.net.URL.

--
Tony Morris
(BInfTech, Cert 3 I.T., SCJP[1.4], SCJD)
Software Engineer
IBM Australia - Tivoli Security Software
(2003 VTR1000F)
 
C

Chris Smith

Marco said:
How can I do this? How can I call this servlet from a java class?

Most likely, one of your other responses will be helpful. If not,
please describe what you mean by "call". The phrase "call a servlet" is
not a well-defined or commonly used phrase, so everyone is guessing at
what you mean by it. You could be more specific about what you'd like
to happen, and possibly get better answers.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top