1 Reply Latest reply on Feb 22, 2013 9:17 PM by gimbal2

    Two servlets communication with Post method

      Dear All,

      We have two servlets application running on same server with Java EE 6 with below mention application URL.

      Servlet1 Application URL: http://<severname>/*servlet1*
      Servlet2 Application URL: http://<severname>/*servlet2*

      My question is how to call Servlet2 from Servlet1 with Post method without using server name.
      May be something like this:


      Please help me on this.

        • 1. Re: Two servlets communication with Post method
          You are free to use a relative url without the host name in it. So you'd simply redirect to "servlet2", not "http://blabla.com/servlet2". But you can also consider doing a forward in stead. Before you ask for code, simply google for "java servlet forward" and "java servlet redirect" to get countless examples.