Spring 3.0 基本配置
首先声明,俺是个新手,做Flex的
刚刚入手Spring3.0 发现和2.5有了一些变化,没有了Spring.jar的核心包,而是把各个功能的包分开了。
这几天就在研究Spring3.0到底咋配置了……,让我狂汗的是并不是配置的有问题,而是Eclipse不自动加载自定义的User library类库,虽然导入了,但是还是不好用……,最后把直接手动倒进去就可以了……
言归正传
经过我一次配置,我挨个试的哦,得出来的结论,其实就是在找不到哪一个累的时候通过
7z l *.jar >123.txt命令把各个jar包里头的class都列在了123文档里,然后查找包得出来的结论
依次找不到或出现异常
ApplicationContextException
FatalBeanException
NestedRuntimeException
ClassVisitor
PropertyAccessor
Spring3.0最基本配置需要一下几个包
org.springframework.asm-3.0.2.RELEASE.jar
org.springframework.beans-3.0.2.RELEASE.jar
org.springframework.context-3.0.2.RELEASE.jar
org.springframework.core-3.0.2.RELEASE.jar
org.springframework.expression-3.0.2.RELEASE.jar
org.springframework.web-3.0.2.RELEASE.jar
置于配置
web.xml
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"><web-app> <display-name>FlexSpring3</display-name> <description>BlazeDS Application</description><context-param><param-name>flex.class.path</param-name><param-value>/WEB-INF/flex/hotfixes,/WEB-INF/flex/jars</param-value></context-param> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath*:configs/applicationContext*.xml </param-value> </context-param> <!-- Spring Listener Config --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- Http Flex Session attribute and binding listener support --> <listener> <listener-class>flex.messaging.HttpFlexSession</listener-class> </listener> <!-- MessageBroker Servlet --> <servlet> <servlet-name>MessageBrokerServlet</servlet-name> <display-name>MessageBrokerServlet</display-name> <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class> <init-param> <param-name>services.configuration.file</param-name> <param-value>/WEB-INF/flex/services-config.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>MessageBrokerServlet</servlet-name> <url-pattern>/messagebroker/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> </welcome-file-list> <!-- for WebSphere deployment, please uncomment --> <!-- <resource-ref> <description>Flex Messaging WorkManager</description> <res-ref-name>wm/MessagingWorkManager</res-ref-name> <res-type>com.ibm.websphere.asynchbeans.WorkManager</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> --></web-app>