Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Communication between two web applications

  1. #1
    Junior Member
    Join Date
    Jul 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Communication between two web applications

    Generally a web service talks to a remote database to fetch required data. In my case, I have a web service that gets the data from another web application (given the url). Both are java based applications. How do I communicate with the remote web application ? via HttpUrlConnection? I need to send JSON Objects and receive JSON Arrays. Are there any code examples that I can refer to? Please guide me.


  2. #2

    Default Re: Communication between two web applications

    One way to communicate is through the ServletContext of different web applications.Firstly you will have to get the ServletContext of different web applications.You can get the ServletContext of another web application by using this.getServletContext().getContext(uripath),and use this ServletContext which is of another web application to share objects and this way you will be able to communicate through them. There may be more and better ways to do this,I am just specifying one.

Similar Threads

  1. Replies: 1
    Last Post: May 4th, 2014, 03:04 AM
  2. Replies: 1
    Last Post: May 4th, 2014, 03:04 AM
  3. how to write jeresy web applications code using @POT, @PUT @DELETE
    By vector_ever in forum Java Theory & Questions
    Replies: 1
    Last Post: July 25th, 2013, 09:32 AM
  4. Replies: 0
    Last Post: July 24th, 2013, 07:17 AM
  5. Servlet communication between two applications on different tomcat seervers
    By siva.batchu in forum What's Wrong With My Code?
    Replies: 0
    Last Post: May 27th, 2013, 08:07 AM