- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
构建整合Hibernate,Spring和BlazeDS的Flex开发环境
构建整合Hibernate,Spring和BlazeDS的Flex开发环境
1.服务器我打算使用预装了BlazeDS的Turn Key Server。
下载BlazeDS的Turnkey Server。
2.安装配置Spring。
?参考/flex-spring/文章,首先下载Flex-Spring.zip文件,将Java文件展开到BlazeDS的Samples的Src目录下。
然后下载最新的Spring的包spring.jar,复制到Samples的WEB-INF的lib目录下。
接下来编辑Samples的Web.xml文件,添加Spring的配置项目
??? ??? !-- Spring configuration file (Not needed if you dont use Spring) --??? context-param??? ??? param-namecontextConfigLocation/param-name??? ??? param-value/WEB-INF/applicationContext.xml/param-value??? /context-param
???? !-- Spring ContextLoaderListener (Not needed if you dont use Spring) --?? ?listener?? ??? ?listener-classorg.springframework.web.context.ContextLoaderListener/listener-class?? ?/listener?
为了让Flex-Remoting能够将Spring的Bean正确传给Flex客户端,我们需要配置基于Spring的Factory。
编辑{Samples}\WEB-INF\flex\services-config.xml文件,添加
??? ?? ??? !-- Spring factory: not needed if you dont use Spring) --??? factories??? ??? factory id=spring class=flex.samples.factories.SpringFactory/??? /factories? 为了使用springfactory,需要将预编译好的flex-spring-factory.jar添加到web-inf的lib目录下
前面下载的Flex-spring.zip包中带了两个Spring的例子程序,为了让Spring能够正确地组装例子对应的Spring Bean,我们需要在WEB-INF目录下创建applicationContext.xml
beans
??? bean id=rateFinderBean class=flex.samples.spring.mortgage.SimpleRateFinder/
??? bean id=mortgageBean class=flex.samples.spring.mortgage.Mortgage????????? property name=rateFinder ref=rateFinderBean/??? /bean?? ???? bean id=dataSource class=org.springframework.jdbc.datasource.DriverManagerDataSource?? ???? property name=driverClassName value=org.hsqldb.jdbcDriver/?? ???? property name=url value=jdbc:hsqldb:hsql://localhost:9002/flexdemodb/?? ???? property name=username value=sa/?? ???? property name=password value=/?? ?/bean
?? ?bean id=productDAOBean class=flex.samples.spring.store.SimpleProductDAO?? ???? property name=dataSource ref=dataSource/?? ?/bean?? ?
/beans
?接下来我们要公开这些Spring Bean的接口给Flex的客户端,编辑Remoting-Config.xml文件
??? ??? destination id=mortgageService??? ??? properties??????? ??? fa
文档评论(0)