Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing a servlet from a Struts App running in another context.  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I answered a similar problem to the context problem in this thread here.
[ December 12, 2002: Message edited by: David O'Meara ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This thread from the JSP forum discussed how to open a socket and write your own mutipart request to a servlet.
Hope this helps,
Dave.
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!