What needs to be in a .war file to deploy a Flex application?

寵の児 提交于 2019-12-13 02:15:37

问题


I've been using Flex Builder 3 to create Flex applications that are part of larger Flex / Java project using LiveCycle Data Services. Flex Builder creates and deploys the .war file, which is convenient for the development cycle, but I don't understand what the .war file has to contain in order to deploy and run.

I've found through trial and error that changing certain properties of the Flex Project (i.e. the Context Root) can break or fix the application, and somehow those settings make it into the .war file.

I need to get the entire build process implemented under Ant, and more importantly, I need to understand what the Flex part of the project depends on. I haven't been able to find any documentation that describes what a .war file has to include to deploy a Flex / Java application, however.

For example, Flex Builder creates a web.xml file and populates it with the correct tags. but if I add other features do I need additional tags in web.xml?

Does anyone know where I can find documentation on the .war file contents for a Flex / Java project?


回答1:


Check out the sample applications here:

http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=build_apps_3.html

Those apps will give you some idea of what needs to go in the WAR. In a nutshell there are four significant locations in a standard WAR and one additional significant location in WAR using LCDS or Blaze DS:

myapp.war/
  WEB-INF/    <-- not accessible via the browser over HTTP
    classes/  <-- compiled classes and configuration files (this is where your .class files and jdbc.properties would go)
    flex/     <-- LCDS XML config files (services-config.xml)
    lib/      <-- web application libraries (.jar files, for LCDS and other tools you might be using)
    web.xml   <-- web application configuration

The Flex application itself will likely sit in the root of myapp.war or in any subdirectory of your choosing except for WEB-INF.

However if you study the sample apps and get your Ant script building the same structure that you see there you shouldn't have too many problems.




回答2:


I don't know anything about LiveCycle Data Services, so that may be an issue. However, I have a flex app that interacts with a java server, and I didn't really have to do anything special for flex apart from what you would do for other static content.

Specifically, I have my flex projects properties ~ Flex Build Path ~ Output folder set to the /flash folder within a java webapp, and ant handles everything else (compiling java files, assembling the class files, adding the web.xml, and turning the files into a war).

Another approach, depending on how adobe handles livecycle, would be to have ant just invoke whatever command flex builder goes through to output a war.



来源:https://stackoverflow.com/questions/263228/what-needs-to-be-in-a-war-file-to-deploy-a-flex-application

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