I have two Java applications A and B.A will upload two files(using multipart) two the tomcat server. And in the servlet of A I want to redirect to a servlet in Application B which is hosted in another system(using response.sendRedirect()). But How can I copy/transfer the uploaded files to the servlet in B?? Database sharing is not preferred.
Can I do this using any of the following methodes.
1.URL Connection
2.Session
3.Adding to response object
Thanks in Advance
Yes you could use Apache’s HTTPClient to POST a file to servlet, See example, In this method your first servlet will first receive the file and then it will act as HTTP client for the second servlet and it will make a POST to second servlet
Also you could transfer file to another server using SFTP if your server is able to communicate on SFTP