• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlet posting to a servlet in another application

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Refer java.net.HttpURLConnection class implementation. Using this you can implement your requirement.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic