ImageVerifierCode 换一换
格式:DOCX , 页数:35 ,大小:630.28KB ,
资源ID:21144719      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/21144719.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(搭建Flex41+Spring+HibernateWord下载.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

搭建Flex41+Spring+HibernateWord下载.docx

1、- Http Flex Session attribute and binding listener support -listenerlistener-classflex.messaging.HttpFlexSession/listener- MessageBroker Servlet -servletservlet-nameMessageBrokerServlet -/display-name-servlet-classflex.messaging.MessageBrokerServletinit-paramparam-nameservices.configuration.filepara

2、m-value/WEB-INF/flex/services-config.xml/init-paramload-on-startup1/servletservlet-mappingurl-pattern/messagebroker/*/servlet-mapping8. 将web工程添加到tomcat中启动tomcat9. 添加Flex工程 右键HCS,选择:添加/更改项目类型添加Flex项目类型注:服务技术选择如下10.点Next,如下配置11.点击Finish,配置Flex 项目属性 在Flex视图下,右键 properties打开项目属性设置对话框12.点击OK,这是工程中的没有http

3、-template文件夹,然后在Flex视图下,右键 properties打开项目属性设置对话框将”生成HTML包装器文件”的钩钩去掉,点击Apply,在将此钩钩 钩上 点击OK,工程下面就会出现http-template文件夹13,这是http-template文件夹下面的index.template.html文件报错,打开此文件,删除这行注释- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. -保存就没错了13. 到了这个

4、时候基本上已经搭建好Flex+bleazeds的web环境,现在来测试一下 1.)新建一个包:com.zuohd.hcs.user.web 2.) 在包中新一个类:HelloWorld,作用flex的一个远程对象,HelloWorld中的代码如下package com.zuohd.hcs.user.web;public class HelloWorld public String sayHelloTo(String name) return Hello +name; 3.) 在HCS/WebRoot/WEB-INF/flex/remoting-config.xml注册这个远程对象destina

5、tion id=Hello com.zuohd.hcs.user.web.HelloWorld/properties/destination 4.) 在src/HCS.mxml 中添加以下代码:?xml version=1.0 encoding=utf-8mx:Application xmlns:mx= layout=absoluteScriptCDATA private function remotingSayHello(event:Event):void var iname:String=tiName.text; say.sayHelloTo(iname); /mx:RemoteObjec

6、t id=say destination= RemoteObjectButton x=335 y=80 label= Click click=remotingSayHello(event);/TextInput x=159 id=tiNameLabel x=10982 text=name:Label text=say.sayHelloTo.lastResult x=44162 width=448 height=71lblView color=#FCEE09 fontSize=20 fontWeight=bold textDecoration=underline fontStyle=normal

7、Application5.) 启动tomcat,等tomcat启动好后,右键单击HCS.mxml,选中Run AsWeb应用程序,效果如下到了这一步,flex+bleazeds已经完成14.添加Spring框架,在MyEclipse Java Enterprise视图下的步骤如下: 点击HCS工程MyEclipseAdd Spring Capabilities点击Next点击Finish点击Keep Existing15. 添加mon,添加SpringFactory.java(网上的) package mon;import org.springframework.context.Applica

8、tionContext;import org.springframework.web.context.support.WebApplicationContextUtils;import org.springframework.beans.BeansException;import org.springframework.beans.factory.NoSuchBeanDefinitionException;import flex.messaging.FactoryInstance;import flex.messaging.FlexFactory;import flex.messaging.c

9、onfig.ConfigMap;import flex.messaging.services.ServiceException;/* * This interface is implemented by factory components which provide * instances to the flex messaging framework. To configure flex data services * to use this factory, add the following lines to your services-config.xml * file (locat

10、ed in the WEB-INF/flex directory of your web application). * * <factories>factory id=spring class=flex.samples.factories.SpringFactory /&/factories& * You also must configure the web application to use spring and must copy the spring.jar * file into your WEB-INF/lib directory. To configure you

11、r app server to use spring, * you add the following lines to your WEB-INF/web.xml file:context-param¶m-name&contextConfigLocation&/param-name¶m-value&/WEB-INF/applicationContext.xml&/param-value&/context-param&listener&listener-class&org.springframework.web.context.ContextLoaderListener&/lis

12、tener-class&/listener& * * Then you put your spring bean configuration in WEB-INF/applicationContext.xml (as per the * line above). For example:UTF-8&DOCTYPE beans PUBLIC -/SPRING/DTD BEAN/ENhttp:/www.springframework.org/dtd/spring-beans.dtdbeans&bean name=weatherBeandev.weather.WeatherService singl

13、eton=true/&/beans& * Now you are ready to define a destination in flex that maps to this existing service. * To do this youd add this to your WEB-INF/flex/remoting-config.xml:WeatherServiceproperties&factory&spring&/factory&source&weatherBean&/source&/properties&/destination& * author Jeff Vroom */p

14、ublic class SpringFactory implements FlexFactory private static final String SOURCE = source; /* * This method can be used to initialize the factory itself. It is called with configuration * parameters from the factory tag which defines the id of the factory. public void initialize(String id, Config

15、Map configMap) * This method is called when we initialize the definition of an instance * which will be looked up by this factory. It should validate that * the properties supplied are valid to define an instance. * Any valid properties used for this configuration must be accessed to * avoid warning

16、s about unused configuration elements. If your factory * is only used for application scoped components, this method can simply * return a factory instance which delegates the creation of the component * to the FactoryInstances lookup method. public FactoryInstance createFactoryInstance(String id, C

17、onfigMap properties) SpringFactoryInstance instance = new SpringFactoryInstance(this, id, properties); instance.setSource(properties.getPropertyAsString(SOURCE, instance.getId(); return instance; / end method createFactoryInstance() * Returns the instance specified by the source * and properties arg

18、uments. For the factory, this may mean * constructing a new instance, optionally registering it in some other * name space such as the session or JNDI, and then returning it * or it may mean creating a new instance and returning it. * This method is called for each request to operate on the * given

19、item by the system so it should be relatively efficient. * * If your factory does not support the scope property, it * report an error if scope is supplied in the properties * for this instance. public Object lookup(FactoryInstance inst) SpringFactoryInstance factoryInstance = (SpringFactoryInstance

20、) inst; return factoryInstance.lookup(); static class SpringFactoryInstance extends FactoryInstance SpringFactoryInstance(SpringFactory factory, String id, ConfigMap properties) super(factory, id, properties); public String toString() return SpringFactory instance for id= + getId() + source= + getSo

21、urce() + scope= + getScope(); public Object lookup() ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(flex.messaging.FlexContext.getServletConfig().getServletContext(); String beanName = getSource(); try return appContext.getBean(beanName); catch (NoSuchBeanDefinit

22、ionException nexc) ServiceException e = new ServiceException(); String msg = Spring service named + beanName + does not exist. e.setMessage(msg); e.setRootCause(nexc); e.setDetails(msg); e.setCode(Server.Processing); throw e; catch (BeansException bexc)Unable to create Spring service named e.setRoot

23、Cause(bexc);16. 在WEB-INF/flex中的services-config.xml中注册SpringFactory工厂factoriesmon.SpringFactory/factories17. 在WEB-INF文件夹下建立conf文件夹,将applicationContext.xml 移入此中,在WEB-INF/web.xml中加入对spring的支持- Spring配置 - Backend configuration -context-paramcontextConfigLocationSpringContextServlet org.springframework.web.context.ContextLoaderServletSprin

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1