2010-06-07 16 views
0

我正在使用BlazeDs。相对上下文根来回Flash应用程序

在services-config.xml中我们得到了以下endPoint的配置。

<channel-definition id="any-amf" class="mx.messaging.channels.AMFChannel"> 
    <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> 
</channel-definition> 

编译Flash应用程序之前,我将context-root设置为compilaction选项。

bin\mxmlc -context-root/-services "flex/services-config.xml" -optimize=true -o ..\..\bin\Messenger.swf Messenger.as 

在我而言,这是“/”

而问题是,messanger.swf能够拉入请求,如果Web应用程序被启动,如Tomcat的webapps ROOT。 我的意思是它只能通过这个URL localhost:8080 /访问。如果我尝试将webaplication移动到另一个文件夹 - 例如localhost:8080/myApplication messenger.swf将无法正常工作sinse我也必须更改root_context。

所以我的问题如何dinamicly确定上下文根在运行时,没有硬编码它作为编译器的选项? 我希望我的.war应用程序正常工作,无论它在webapps文件夹(url)中的位置如何。

谢谢

回答

0

在这种情况下,我建议设置你的渠道的终点在运行时 - 程序执行过程中不能更改上下文根变量。

相关问题