This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
HI, I want to access a servlet which is running in another context from a struts application which is running in a different context.Whether it is possible? And how we can access a doPost () method of the servlet from a Struts Action class? Please advise me Thanks in advance.
Emailed by Tomson Antony Thanks for your reply. But i would like to explain the whole scenario. I am using struts application through which i am contacting the ejbs in the app server. The requirement is that i want to write a file which has been uploaded by the client to the m/c where app server is running. Suppose my web container ie, struts appl. is running in another m/c. Since ejbs doesnot sopport file I/O operation, I've developed a servlet instead in the app server. If i am accessing the servlet directly from the submit form, im violating the mvc rule, which i dont want. So the scenario is that i want to send a file object or a multipart request to that servlet. I got some idea from other resources that, to open a URLConnection. But i dont know how i can send a multipart request. Hope u'll provide me with some idea. Sorry for a lengthy mail.And thaks for your help. regards, Tomson Antony
I think I understand your current situation, and you can solve it by sending a multipart request from the web server to the application server. The format of a multipart request including an upload file has been discussed before, I'll go have a look for that thread... Dave