- 浏览: 119561 次
- 性别:
- 来自: 北京
最新评论
-
NewTamato:
你的这个写的全都是代码,不知道对于flex和spring整合的 ...
Flex+BlazeDS+Spring的一个项目笔记(2) -
agurick:
laowood 写道在不写的一般情况下都是auto吧?自动变量 ...
C中的寄存器变量和引用变量 -
laowood:
agurick 写道补充一下,auto已经过时,已经不再使用。 ...
C中的寄存器变量和引用变量 -
agurick:
补充一下,auto已经过时,已经不再使用。static 变量就 ...
C中的寄存器变量和引用变量 -
ming:
oooooooo
domino如何在数据库中存储信息
applicationContext.xml 配置如下
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="loginBean" class="com.lms.shop.login.LoginDAO"> <property name="dataSource" ref="websphereDataSource"></property> </bean>
<!--data source 是从 websphere配置的 jndi 获取--> <bean id="websphereDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="webspherejndi"/> <property name="resourceRef" value="false"/> </bean>
<!--事务管理--> <bean id="trans" class="org.springframework.transaction.jta.WebSphereTransactionManagerFactoryBean"/> <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="transactionManager" ref="trans"/> </bean> </beans>
flex 有四个配置文件不可缺少 在 flex文件夹下可以看到
三种通信方式的配置(messaging-config.xml,proxy-config.xml,remoting-config.xml)和总控配置(services-config.xml).
此工程中只用到了 remoting通信方式,简单灵活。
为了让spring 来管理 flex 和 服务器端通信 services-config.xml 稍微修改一下。
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<services>
<service-include file-path="remoting-config.xml" />
</services>
<!--这里配置一个 factorices -->
<factories>
<factory id="spring" class="com.lms.shop.factories.SpringFactory"/>
</factories>
<security>
<login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/>
</security>
<channels>
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
<channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
<endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
</properties>
</channel-definition>
<channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>true</polling-enabled>
<polling-interval-seconds>4</polling-interval-seconds>
</properties>
</channel-definition>
</channels>
<logging>
<target class="flex.messaging.log.ConsoleTarget" level="Error">
<properties>
<prefix>[BlazeDS] </prefix>
<includeDate>false</includeDate>
<includeTime>false</includeTime>
<includeLevel>false</includeLevel>
<includeCategory>false</includeCategory>
</properties>
<filters>
<pattern>Endpoint.*</pattern>
<pattern>Service.*</pattern>
<pattern>Configuration</pattern>
</filters>
</target>
</logging>
<system>
<redeploy>
<enabled>false</enabled>
</redeploy>
</system>
</services-config>
SpringFactory.java 的内容如下 ,,客户端调用的 FlexServlet 全由这个工厂来生成
package com.lms.shop.factories; import org.springframework.context.ApplicationContext; 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.config.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 (located 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 your app server to use spring, * you add the following lines to your WEB-INF/web.xml file: * * <context-param> * <param-name>contextConfigLocation</param-name> * <param-value>/WEB-INF/applicationContext.xml</param-value> * </context-param> * * <listener> * <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> * </listener> * * Then you put your spring bean configuration in WEB-INF/applicationContext.xml (as per the * line above). For example: * * <?xml version="1.0" encoding="UTF-8"?> * <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> * * <beans> * <bean name="weatherBean" class="dev.weather.WeatherService" singleton="true"/> * </beans> * * Now you are ready to define a destination in flex that maps to this existing service. * To do this you'd add this to your WEB-INF/flex/remoting-config.xml: * * <destination id="WeatherService"> * <properties> * <factory>spring</factory> * <source>weatherBean</source> * </properties> * </destination> * * @author Jeff Vroom */ public 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, ConfigMap 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 warnings 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 FactoryInstance's lookup method. */ public FactoryInstance createFactoryInstance(String id, ConfigMap 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 arguments. 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 item by the system so it should be relatively efficient. * <p> * 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) 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=" + getSource() + " scope=" + getScope(); } public Object lookup() { ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(flex.messaging.FlexContext.getServletConfig().getServletContext()); String beanName = getSource(); try { return appContext.getBean(beanName); } catch (NoSuchBeanDefinitionException 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) { ServiceException e = new ServiceException(); String msg = "Unable to create Spring service named '" + beanName + "' "; e.setMessage(msg); e.setRootCause(bexc); e.setDetails(msg); e.setCode("Server.Processing"); throw e; } } } }
发表评论
-
redhat 安装 oracle
2013-01-23 12:02 1054装完RHEL5之后遇到的 第一个问题 通过SSH ... -
fedora 14上安装 Oracle 11g
2011-03-31 12:48 4053本文介绍了在Fedora 14 64-bit上安装Or ... -
Flex+BlazeDS+Spring的一个项目笔记(1)
2009-07-29 23:43 1647把最近在做的一个项目的研究成果贴出来做个笔记。项目是要做一个本 ... -
SQL能完成的逻辑都在SQL中
2009-07-21 19:16 1039decode, case的用法 select t.star ... -
Promises don't come easy
2009-05-11 13:48 1131I should have known all along ... -
oracle 9*9乘法口诀表
2009-04-14 18:19 1961select replace(reverse(sys_conn ... -
oracle笔记1
2009-03-31 22:52 1466conn / as sysdba -切换到sys用户 sele ... -
C中的寄存器变量和引用变量
2009-03-25 19:11 5612总共有auto,static,register,extern。 ... -
shell 初步
2009-03-15 18:24 3572ps -ef | grep redis du -sh 查看文件 ... -
File ToBase64String
2009-02-03 15:00 1214public static string Serializ ... -
David Cook - Always Be My Baby
2008-11-05 18:28 1335Studio Version Song ... -
企业应用中C\S是怎样的架构?
2008-10-31 10:19 3975我们公司开发程序一般是 C# Winform 做客户端,EJB ... -
C#画图
2008-10-24 10:06 2368翻出以前刚到公司自己做的这个,以前查资料作了半天,发现 现在 ... -
Can’t find P/Invoke DLL sqlcemeNN.dll
2008-09-01 11:30 2388Can’t find P/Invoke DLL sqlceme ... -
JavaScript replace() 方法
2008-08-27 13:43 2259定义和用法 replace() 方法用于在字符串中 ... -
C# 写Excel 代码
2008-08-20 12:48 10882C# 中使用 Excel using System;usin ... -
开发基于Domino/Notes的动态Web网站
2007-09-27 08:08 1486开发基于Domino/Notes的动态Web网站 用户的需求 ... -
[精华]Linux记事本最常用的命令,迅速掌握Linux
2008-06-28 09:51 4369自己整理的笔记,,适合linux初学者,老手就不要看了,呵呵 ... -
Java移动文件
2008-06-14 19:50 34486一: //文件原地址 File oldFile = ne ... -
大道至简-java之23种模式一点就通
2008-06-12 10:23 1580一、创建型模式 FACTORY ...
相关推荐
Flex PureMVC Flex BlazeDS Spring Hibernate 整合 里面一些图标是包双击可查看源代码
flex 结合spring,完成前后台数据传递。
原创作品手录 前言:本讲是继【第三讲:WEB项目-集成Flex3+BlazeDS3.2+Spring2.5.6】...2、易于集成到原有的Struts2+Spring2的项目中,依旧使用Struts2的MVC,添加借助于Spring的DispatcherServlet整合入Flex的功能;
使用flex 4.5 + Spring 3.0 + Hibernate 3.3 + Cairngorm 2.2.1 + BlazeDS 3.3.0 + Spring BlazeDS Integration 1.0.3整合出的一个登录的小demo·
前言:本讲是在【第四讲:WEB项目-集成Flex3+BlazeDS3.2+Spring2.5.6+iBatis2.3.4】的基础上添加iBatis,此次集成其实质是Spring与Struts2的整合而已 目标:WEB项目-集成Flex3+BlazeDS3.2+Spring2.5.6+iBatis2.3.4+...
跟我一步步搭建PureMVC+Flex+BlazeDS+Spring+Hibernate
前言:本讲是在【第三讲:WEB项目-集成Flex3+BlazeDS3.2+Spring2.5.6】方式二的基础上添加iBatis,此次集成其实质是Spring与iBatis的整合而已 目标:WEB项目-集成Flex3+BlazeDS3.2+Spring2.5.6+iBatis2.3.4 再需...
一步一步讲解了PureMVC+Flex+BlazeDS+Spring+Hibernate的搭建,适合初学者参照
MyEclipse7.5+flex4+spring3.0.5+struts2.2.1+hibernate3.6.0+blazeds4.0.0.14931完美整合方案 内附所需jar包和源代码
跟我一步步搭建 PureMVC+Flex+BlazeDS+Spring+Hibernate
Flex+BlazeDS+Spring 软件环境配置搭建,一步步教学,逐渐搭建起项目所需要的框架
Flex + blazeds + Java推送Demo 本例实现由Flex一端客户端发送消息, 然后由Java端在发布到所有...里面有说明与源码, 还有一个直接放到Tomcat里面的直接发布的项目 小编使用工具 eclipse3.5 flex sdk4.6 jdk1.6 blzaeds
一步步搭建+PureMVC+Flex+BlazeDS+Spring+Hibernate
此案例用到的框架是Flex+BlazeDS+Spring+Hibernate完成了三个案例的整合,用到的数据库脚本已经在项目中。只需要加压,在软件中导入,执行数据库脚本,项目就可以运行。
Flex4+Blazeds4.0+Spring3.0+hibernate2.5.2整合笔记,自己看了不少网上所说,都没配置成功,后来通过spring的一个插件搞定了,希望对大家有帮助吧!
Flex+blazeDS+Spring官方Demo,环境搭建,内含十几个例子,从易到难,包括spring消息,spring安全,注解方式和非注解配置文件方式,十分好用。内含有tomcat,可直接启动并运行用户手册。
Flex+Blazeds+Spring+Hibernet+Mysql整合工程,导入eclipse即可
flex+spring+blazeds在MyEclipse下非常详细的结合配置
Flex+JAVA+BlazeDS开发环境配置(Java工程和Flex工程独立).doc
本课程主要是讲解Flex 4.6和ActionScript 3.0使用方法和技巧