Deploying my flex application

穿精又带淫゛_ 提交于 2019-12-24 07:07:06

问题


I am doing some trial testing awith Amazon ec2 boxes, deploying flex apps running on top of restlet powered webservices. I have this problem - Everytime i deploy the app to the cloud, I'm having to hardcode the IP address of the server into the ActionScript/MXML files (http://72.93.48.39:8080/xxx/abc/) and for certain reasons, i am forced to choose a different IP everytime. and i think its really not the right way to deploy the application.

I would like to know what other people do in such scenarios?

On thinking about it, i thought i could make it pickup values from the HTMLVars of the HTML wrapper. but that again has to be edited everytime again and again.

will it be possible to be able to supply these values : server's ip address, server's port number(in case its not 8080 on some machine) at build time? if so can anyone give me a barbones sample build.xml just as an example?


回答1:


After much research I (think) have finally found a way to do this. the solution is ant's build.xml file based

the solution is to use EnvGen ant Task to generate a "config.xml" file of sorts. The EnvGen task works on the FreeMarker model - so it takes data and a template to generate files. Data is to be supplied via a CSV file. Template is to be specified using the Freemarker Template .ftl file. Depending on the template EnvGen generates XML files too. the link to EnvGen Task is here - http://www.basilv.com/psd/software-files/EnvGen/index.html#InstallEnvGen

And finally, we program the Flex app to pick up the server end point values from the config.xml file.

Hope this helps someone who is looking for this answer



来源:https://stackoverflow.com/questions/2658614/deploying-my-flex-application

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!