I am migrating my application from JBOSS 5.0 to JBOSS 7.2 version server.
I am running 2 web projects in the same IP.
I am trying to connect from the first project servlet to the second servlet which is running in the another web project using sendRedirect() method.
After passing url to the sendRedirect() method it is appending with first projectcontext url (https://11.11.111.111:9999/servicename1/).
response.sendRedirect("https:/11.11.111.111:9999/servicename2/TestController?id=12345&testid=999999&sessionId=wFqBO7yz0itp52sVylWRBRwxSy6ZnMc-VsmdfAZf&tName=test");
I am not getting any exception in the logs.
web.xml(From webproject1)
<web-app>
<servlet>
<servlet-name>TestController</servlet-name>
<servlet-class>org.test.controller.TestController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TestController</servlet-name>
<url-pattern>/TestController</url-pattern>
</servlet-mapping>
</web-app>
Can someone please help me to resolve this issue. Thanks in advance.
To redirect the request across the project from the same servlet container get the ServletContext by project name and use the request Dispatcher eg:-