1 Reply Latest reply on Dec 14, 2005 10:30 AM by andiwauss

    Sending request from one WAR to another WAR (CrossContext)..

    prakalp

      Dear All,

      I would like to send a request from one WAR (application) to another WAR(application) ....

      Ex:
      --------------------------------------------------------------------------------------CODE => THIS IS A CODE EXCERPT FROM SERVLET DEPLOYED UNDER A CONTEXT 'XYZ'

      ServletContext ctx = getServletContext().getContext("abc");
      RequestDispatcher rd = null;
      if(ctx!=null)
      rd = ctx.getRequestDispatcher("login.jsp");
      else
      out.println("OOPPPS!!! abc Context is null...");


      if(rd!=null)
      rd.forward(req,response);
      else
      out.println("OOPPPS!!! RequestDispatcher is null..");
      --------------------------------------------------------------------------------------
      Following are the jboss-web.xml files for two applications

      'xyz' context : <jboss-web>
      <virtual-host>initial.test.com</virtual-host>
      <context-root>/xyz</context-root>
      </jboss-web>

      'abc' context:
      <jboss-web>
      <virtual-host>initial.test.com</virtual-host>
      <context-root>/abc</context-root>
      </jboss-web>

      ------------------------------------------------------------------------

      I remember a similar kind of functionality in Tomcat where in server.xml we have to set 'crossContext=true'.

      Can any one tell me how can i acheive the same thing in JBOSS?

      Thanks in advance.

      Kind Regards,
      prakalp