pureMVC + BlazeDS 3.3 + Spring2.5.6 + iBAITS 2.3.4 +mysql database

 These days , i am assigned to do a new project (named guosen securities), use the following architecture:

 

selected techniques:  pureMVC + BlazeDS 3.3 + Spring-Flex1.0.3 + Spring2.5.6 + iBAITS 2.3.4 +mysql database

 

pureMVC : A mvc framework for FLEX ,i am not familiar.  i learned it from the internet, i should be an framework like Struts in java.

BlazeDS : A opensource framwork used to associate Flex  and java.

Spring-Flex1.0.3 : A project used to associate BlazeDS and Spring.

Spring2.5.6: As an Java developer ,i dont want to say it

iBAITS 2.3.4 : also.

mysql database: also.

 

i spent a few days to  making these framework work together.

some other day ,i will upload the spec config files.

but if anyone has any problem about above, it 's welcome to contact me ,

my e-mail: guolong1983811@163.com  , i can see chinese,haha , but i am learning english now ,so...


web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>logindemo</display-name>

<!-- spring mvc -->
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:/applicationContext.xml </param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/messagebroker/*</url-pattern>
</servlet-mapping>




<!-- spring IOC -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath*:/applicationContext.xml               
 
        </param-value>
</context-param>

   <!-- Http Flex Session attribute and binding listener support -->
    <listener>
        <listener-class>flex.messaging.HttpFlexSession</listener-class>
    </listener>

</web-app>

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" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">


<import resource="classpath*:spring-dao-config.xml" />
<import resource="classpath*:spring-service-config.xml" />
<import resource="classpath*:spring-ibatis-config.xml" />




</beans>

spring-service-config.xml

<?xml version="1.0" encoding="UTF-8"?>   
<beans xmlns="http://www.springframework.org/schema/beans"  
xmlns:flex="http://www.springframework.org/schema/flex"  
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.5.xsd   
http://www.springframework.org/schema/flex   
http://www.springframework.org/schema/flex/spring-flex-1.0.xsd">  
<flex:message-broker/>

<flex:remoting-destination ref="loginService" />

<bean id="loginService" class="com.guosen.qudao.service.impl.LoginServiceImpl"/>
</beans>

spring-ibatis-config.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" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">


<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:jdbc.properties</value>
</property>
</bean>


<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName">
<value>${jdbc.driverClassName}</value>
</property>
<property name="url">
<value>${jdbc.url}</value>
</property>
<property name="username">
<value>${jdbc.username}</value>
</property>
<property name="password">
<value>${jdbc.password}</value>
</property>


<property name="defaultAutoCommit">
<value>${jdbc.defaultAutoCommit}</value>
</property>
</bean>


<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<value>classpath:ibatis/sql-map-config.xml</value>
</property>
<property name="dataSource" ref="dataSource" />
</bean>

</beans>

spring-dao-config.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" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">


<bean id="loginDao" class="com.guosen.qudao.dao.impl.LoginDaoImpl">
<property name="dataSource" ref="dataSource" />
<property name="sqlMapClient" ref="sqlMapClient" />
</bean>


</beans>


sql-map-config.xml


<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE sqlMapConfig 
PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN" 
"http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<sqlMap resource="ibatis/login-sql-mapping.xml" />
</sqlMapConfig>


messaging-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<service id="message-service" 
    class="flex.messaging.services.MessageService">


    <adapters>
        <adapter-definition id="actionscript" class="flex.messaging.services.messaging.adapters.ActionScriptAdapter" default="true" />
        <!-- <adapter-definition id="jms" class="flex.messaging.services.messaging.adapters.JMSAdapter"/> -->
    </adapters>


    <default-channels>
        <channel ref="my-polling-amf"/>
    </default-channels>


</service>

remoting-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service" 
    class="flex.messaging.services.RemotingService">


    <adapters>
        <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
    </adapters>


    <default-channels>
        <channel ref="my-amf"/>
    </default-channels>


</service>


services-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<services-config>


<services>
<service-include file-path="remoting-config.xml" />
<service-include file-path="proxy-config.xml" />
<service-include file-path="messaging-config.xml" />
<default-channels>  
           <channel ref="my-amf"/>  
        </default-channels>  
</services>


<security>
<login-command class="flex.messaging.security.TomcatLoginCommand"
server="Tomcat" />
<!-- Uncomment the correct app server 
<login-command class="flex.messaging.security.TomcatLoginCommand" server="JBoss"/>
<login-command class="flex.messaging.security.JRunLoginCommand"server="JRun"/>
<login-command class="flex.messaging.security.WeblogicLoginCommand" server="Weblogic"/>
<login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/> 
-->


<!-- 
<security-constraint id="basic-read-access"> 
<auth-method>Basic</auth-method> 
<roles> 
<role>guests</role> 
<role>accountants</role> 
<role>employees</role>
<role>managers</role> 
</roles> 
</security-constraint> 
-->
</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>false</polling-enabled>
<polling-interval-seconds>4</polling-interval-seconds>
</properties>
</channel-definition>

<!-- 
<channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel"> 
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http"
class="flex.messaging.endpoints.HTTPEndpoint"/> 
</channel-definition> 
<channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel"> 
<endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" 
class="flex.messaging.endpoints.SecureHTTPEndpoint"/> 
<properties> 
<add-no-cache-headers>false</add-no-cache-headers> 
</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>
<!-- 
<watch-interval>20</watch-interval> 
<watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file> 
<watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file> 
<watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file> 
<watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file> 
<watch-file>{context.root}/WEB-INF/flex/data-management-config.xml</watch-file> 
<touch-file>{context.root}/WEB-INF/web.xml</touch-file> 
-->
</redeploy>
</system>


</services-config>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值