Tomcat: POST from one servlet or internal class to another servlet

S

Sean Clarke

Hi,
I am trying to POST some data from a class within one servlet to another
servlet (so I can reuse it)...

More info? an internal class of one of the servlet generates some XML, this
XML then needs to be HTTP POST'ed to another servlet for processing on the
same server, what is the best way of achieving it?

I have looked around and seen some methods that look useful, but the are all
deprecated (in ServletContext), I could fudge it using paths etc. (but what
about ports?), I'd like to do it properly.

Can anyone shed some light?

Many thanks
 
S

Sudsy

Sean said:
Hi,
I am trying to POST some data from a class within one servlet to another
servlet (so I can reuse it)...

More info? an internal class of one of the servlet generates some XML, this
XML then needs to be HTTP POST'ed to another servlet for processing on the
same server, what is the best way of achieving it?

I have looked around and seen some methods that look useful, but the are all
deprecated (in ServletContext), I could fudge it using paths etc. (but what
about ports?), I'd like to do it properly.

Can anyone shed some light?

I had to do something comparable in order to get JSP output to
store in a file. You do it just like you would from a client:
URL#openConnection, setDoOutput( true ), etc. Fairly basic.
 

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

Staff online

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top