Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Context Paths in web clients of enterprise applications  RSS feed

 
Sandareka Fernando
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an enterprise application with two different web clients. Say web1 and web2(I'm using netbeans 6 with Glass Fish V2)

Initially when running the enterprise application, the context path is set to /web1Home.jsp. I'm trying to have a reference from this jsp page to another jsp page in the next web application(web2).

Is this possible? If it is possible how can I change the context path to /web2. When I try to do this, application is looking for the second jsp page also in the same context path as the first one and gives a file not found error.

PWC6117: File "D:\Enterprice1\dist\gfdeploy\web1_war\web2Home.jsp" not found
 
Schandha Ravi
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

What I understand from your question is about cross context communication. As fas as I know, you can't refer any resource which is external to your context. But what you can do is to open a socket connection (URLConnection) to the other context. Search on "Cross Context Communication" and I'm sure there are many posts already on this.
 
Sandareka Fernando
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
[ November 29, 2008: Message edited by: Sandareka Fernando ]
 
Raf Szczypiorski
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if this is what you want, but JSTL has a <c:import> tag, and one of the attributes is a context, so that you can dynamically include resources from other contexts on the same server.
Also, you can try:

Of course, you may not like it as it is low level, and you should ckech for null return values, but if nothing else is available, this is always there for you, and can be a basis for a custom tag or sth.
Regards.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!