• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet posting to a servlet in another application  RSS feed

 
Jenn Person
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have two applications running in Tomcat: A website for customers and an administrative back-end.

I have a servlet in the back-end that does a little processing and then needs to post an update to a servlet in the customer's side.

Is this possible? How can it be done?

Thanks,
Jenn
 
Yellaiah Gopireddy
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Refer java.net.HttpURLConnection class implementation. Using this you can implement your requirement.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If they need to work together, why make them two separate applications?
Why not just add some administrator components to the application?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Yella G", you have previously been warned on multiple occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional, and this is your final warning. Adjust your display name to comply with the required standards prior to your next post.

Failure to comply will result in the removal of your account.

bear
JavaRanch Sheriff
 
Jenn Person
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
If they need to work together, why make them two separate applications?
Why not just add some administrator components to the application?


I had done that originally, but these two sites are being used to replace an old static website and the network administrator insists they be separated so he can apply SSL to the administrative end. He demanded complete separation of the two sites, so my hands are tied in this case.

Any suggestions?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's very easy to force certain URL patterns to go through SSL with Java web apps. But... if his mind is made up it's made up.

For some reason this is a common topic here (cross context servlet communication) so you'll find plenty of discussions if you use the search feature.

Before making any suggestions, can you clarify what you mean by:
I have a servlet in the back-end that does a little processing and then needs to post an update to a servlet in the customer's side.

?


If the two apps share a common database, you might not need to actually post to the 'customer' app. Otherwise, if you mean that you need to make HTTP posts from one application to another, you might want to look into the httpclient libraries from the Apache Jakarta group:
http://jakarta.apache.org/commons/httpclient/
[ April 05, 2007: Message edited by: Ben Souther ]
 
Jenn Person
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ben,

I need to make a HTTP posts from one application to another, whereas the two applications are both maintained in the same container.

I'll take a look at the libraries to see if I can figure it out!

Thanks,
Jenn
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!