@ContextRoot() will get it embedded, might be easiest just to put that in your Application and have your AS classes pull Application.application.yourContextRootVarDeclaredOnApplication.  Otherwise you could attempt to figure out the context root simply by taking the value between the first and second slash after the domain.  Most webapps get installed under the domain root as opposed to deeper in the path.  Obviously this depends on your setups and if giving a WAR to a customer you can’t rely on it.  But if you’re in control…

 

Matt

 


From: [email protected] [mailto:[email protected]] On Behalf Of sbyrne_dorado
Sent: Saturday, June 11, 2005 9:24 AM
To: [email protected]
Subject: [flexcoders] Obtaining context root programmatically?

 

Is there any way within an AS file to find out the current context root? 

I have discovered that if I use the <mx:String> element, that the MXML
translator will correctly replace @ContextRoot() with the current
context root, which is fine, but I am wondering if there is a less
hacky way to obtain this information from just ActionScript?

[this is all in building a file upload/download pair of components
that have to do getURLs to talk to JSP pages and servlets, and thus
need to know the context root to correctly sent out the URLs]





Yahoo! Groups Links

Reply via email to