Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

communication between two webapps which are in the same server

 
siva krishna pallapu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi friends,

Here is my requirement I have a jsp page, jsp1.jsp in app1. The jsp page consists of header, footer and body, the header and footer are in the app1 and I need to display jsp2.jsp in the body part of jsp1 which is to be rendered through action class or a sevlet of the app2 and is below is my code in body of jsp1.jsp

ServletContext sc=null;
sc=request.getSession().getServletContext().getContext("/app2");
System.out.println("sc-->"+sc);

RequestDispatcher rd=sc.getRequestDispatcher("authenticate.do");
rd.include(request, response);

but the code is giving the following error in both Tomcat and JBoss
The requested resource (/app2/authenticate.action) is not available
and I kept <Context crossContext="true"> in context.xml in Tomcat too

Thanks in advance

Siva
 
Rudy Gireyev
Ranch Hand
Posts: 39
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understood what you are after, you can simply use the jsp:include command in your jsp1.jsp

<jsp:include page="jsp2.jsp" />

Rudy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic