----- Original Message ----- From: "Angel Sotirov" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Wednesday, September 05, 2007 4:23 PM
Subject: tomcat 6 application intercommunication

hi guys,

We have two application running on the same tomcat instance /app1  and
/app2. We need to run app2 from app1. Trying to do so calling /app2
directly results in a call to host/app1/app2. Is there a way to find the
FQDN of the current virtual server so that we can call server/app2
directly or maybe some other neat solution?

If I understand you... try this.

String callingURL = request.getRequestURL().toString();
String thisContext = request.getContextPath();
int contextIndex = callingURL.indexOf(thisContext );
String callingURLwithOutContext = callingURL.substring(0,contextIndex ); String app2Context = callingURLwithOutCntext + "/" + app2;

Maybe ;)  and my choice of names really sucks



We are using tomcat 6 and java-1.5.0.12

Cheers,

Angel

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to