<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-34  評論-1965  文章-0  trackbacks-0

    IoC(Inversion of Control,以下譯為控制反轉(zhuǎn))隨著Java社區(qū)中輕量級容器(Lightweight Contianer)的推廣而越來越為大家耳熟能詳。在此,我不想再多費(fèi)唇舌來解釋“什么是控制反轉(zhuǎn)”和“為什么需要控制反轉(zhuǎn)”。因?yàn)榛ヂ?lián)網(wǎng)上已經(jīng)有非常多的文章對諸如此類的問題作了精彩而準(zhǔn)確的回答。大家可以去讀一下Rod Johnson和Juergen Hoeller合著的《Expert one-on-one J2EE Development without EJB》或Martin Fowler所寫的《Inversion of Control Containers and the Dependency Injection pattern》。

    言歸正傳,本文的目的主要是介紹在Struts 2中實(shí)現(xiàn)控制反轉(zhuǎn)。

    歷史背景

    眾所周知,Struts 2是以Webwork 2作為基礎(chǔ)發(fā)展出來。而在Webwork 2.2之前的Webwork版本,其自身有一套控制反轉(zhuǎn)的實(shí)現(xiàn),Webwork 2.2在Spring 框架的如火如荼發(fā)展的背景下,決定放棄控制反轉(zhuǎn)功能的開發(fā),轉(zhuǎn)由Spring實(shí)現(xiàn)。值得一提的是,Spring確實(shí)是一個(gè)值得學(xué)習(xí)的框架,因?yàn)橛性絹碓蕉嗟拈_源組件(如iBATIS等)都放棄與Spring重疊的功能的開發(fā)。因此,Struts 2推薦大家通過Spring實(shí)現(xiàn)控制反轉(zhuǎn)。

    具體實(shí)現(xiàn)

    首先,在開發(fā)環(huán)境中配置好Struts 2的工程。對這部分仍然有問題的朋友,請參考我的早前的文章。

    然后,將所需的Spring的jar包加入到工程的構(gòu)建環(huán)境(Build Path)中,如下圖1所示:

    圖1 所依賴的Spring的jar包
    圖1 所依賴的Spring的jar包

    本文使用的是Spring 2.0,Spring強(qiáng)烈建議大家在使用其jar包時(shí),只引用需要的包,原因是Spring是一個(gè)功能非常強(qiáng)大的框架,其中有些功能是您不需要的;而且Spring提倡的是“按需所取”,而不是EJB的“愛我就要愛我的一切”。當(dāng)然,如果你怕麻煩或者是不清楚每個(gè)包的作用,引用一個(gè)Spring的總包也未嘗不可。

    接下來,就要修改WEB-INF\web.xml文件了,內(nèi)容為:

    <? xml version="1.0" encoding="UTF-8" ?>
    < web-app version ="2.4" xmlns ="http://java.sun.com/xml/ns/j2ee"
    ? ? xmlns:xsi
    ="http://www.w3.org/2001/XMLSchema-instance"
    ? ? xsi:schemaLocation
    ="http://java.sun.com/xml/ns/j2ee?
    ? ? http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    >

    ? ?
    < display-name > Struts 2 IoC Demo </ display-name >

    ? ?
    < filter >
    ? ? ? ?
    < filter-name > struts-cleanup </ filter-name >
    ? ? ? ?
    < filter-class >
    ? ? ? ? ? ? org.apache.struts2.dispatcher.ActionContextCleanUp
    ? ? ? ?
    </ filter-class >
    ? ?
    </ filter >

    ? ?
    < filter >
    ? ? ? ?
    < filter-name > struts2 </ filter-name >
    ? ? ? ?
    < filter-class >
    ? ? ? ? ? ? org.apache.struts2.dispatcher.FilterDispatcher
    ? ? ? ?
    </ filter-class >
    ? ?
    </ filter >

    ? ?
    < filter-mapping >
    ? ? ? ?
    < filter-name > struts-cleanup </ filter-name >
    ? ? ? ?
    < url-pattern > /* </ url-pattern >
    ? ?
    </ filter-mapping >

    ? ?
    < filter-mapping >
    ? ? ? ?
    < filter-name > struts2 </ filter-name >
    ? ? ? ?
    < url-pattern > /* </ url-pattern >
    ? ?
    </ filter-mapping >

    ? ?
    < listener >
    ? ? ? ?
    < listener-class >
    ? ? ? ? ? ? org.springframework.web.context.ContextLoaderListener
    ? ? ? ?
    </ listener-class >
    ? ?
    </ listener >

    ? ?
    < welcome-file-list >
    ? ? ? ?
    < welcome-file > index.html </ welcome-file >
    ? ?
    </ welcome-file-list >
    </ web-app >
    清單1 WEB-INF\web.xml

    大家一看便知道,主要是加入Spring的ContextLoaderListener監(jiān)聽器,方便Spring與Web容器交互。

    緊接著,修改Struts.properties文件,告知Struts 2運(yùn)行時(shí)使用Spring來創(chuàng)建對象(如Action等),內(nèi)容如下:

    struts.objectFactory = spring
    清單2 classes\struts.properties

    再下來,遵循Spring的原則——面向接口編程,創(chuàng)建接口ChatService,代碼如下:

    package tutorial;

    import java.util.Set;

    public interface ChatService {
    ? ?Set
    < String > getUserNames();
    }
    清單3 tutorial.ChatService.java

    然后,再創(chuàng)建一個(gè)默認(rèn)實(shí)現(xiàn)ChatServiceImpl,代碼如下:

    package tutorial;

    import java.util.HashSet;
    import java.util.Set;

    public class ChatServiceImpl implements ChatService {

    ? ?
    public Set < String > getUserNames() {
    ? ? ? ?Set
    < String > users = new HashSet < String > ();
    ? ? ? ?users.add(
    " Max " );
    ? ? ? ?users.add(
    " Scott " );
    ? ? ? ?users.add(
    " Bob " );
    ? ? ? ?
    return users;
    ? ?}


    }
    清單4 tutorial.ChatServiceImpl.java

    接下來,就該新建Action了。tutorial.ChatAction.java的代碼如下:

    package tutorial;

    import java.util.Set;

    import com.opensymphony.xwork2.ActionSupport;

    public class ChatAction extends ActionSupport {
    ? ?
    private static final long serialVersionUID = 8445871212065L ;?
    ? ?
    ? ?
    private ChatService chatService;
    ? ?
    private Set < String > userNames;

    ? ?
    public void setChatService(ChatService chatService) {
    ? ? ? ?
    this .chatService = chatService;
    ? ?}

    ? ?
    ? ?
    public Set < String > getUserNames() {
    ? ? ? ?
    return userNames;
    ? ?}

    ? ?
    ? ?@Override
    ? ?
    public String execute() {
    ? ? ? ?userNames
    = chatService.getUserNames();
    ? ? ? ?
    return SUCCESS;
    ? ?}

    ? ?
    }
    清單5 tutorial.ChatAction.java

    ChatAction類使用屬性(Getter/Setter)注入法取得ChatService對象。

    然后,配置Spring的applicationContext.xml(位于WEB-INF下)文件,內(nèi)容如下:

    <? 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 ="chatService" class ="tutorial.ChatServiceImpl" />
    ? ?
    < bean id ="chatAction" class ="tutorial.ChatAction" scope ="prototype" >
    ? ? ? ?
    < property name ="chatService" >
    ? ? ? ? ? ?
    < ref local ="chatService" />
    ? ? ? ?
    </ property >
    ? ?
    </ bean >
    </ beans >
    清單6 WEB-INF\applicationContext.xml

    上述代碼有二點(diǎn)值得大家注意的:

    1. Struts 2會為每一個(gè)請求創(chuàng)建一個(gè)Action對象,所以在定義chatAction時(shí),使用scope="prototype"。這樣Spring就會每次都返回一個(gè)新的ChatAction對象了;
    2. 因?yàn)镃hatServiceImpl被配置為默認(rèn)的scope(也即是singleton,唯一的),所以在實(shí)現(xiàn)時(shí)應(yīng)保證其線程安全(關(guān)于編寫線程安全的代碼的討論已經(jīng)超出本文的范圍,更超出了本人的能力范圍,大家可以參考Addison Wesley Professional出版的《Java Concurrency in Practice》)。

    接下來,在classes/struts.xml中配置Action,內(nèi)容如下:

    <! DOCTYPE struts PUBLIC
    ? ? ? ? "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    ? ? ? ? "http://struts.apache.org/dtds/struts-2.0.dtd"
    >
    < struts >
    ? ?
    < include file ="struts-default.xml" /> ? ?
    ? ??
    ? ?
    < package name ="Struts2_IoC" extends ="struts-default" >
    ? ? ? ?
    < action name ="Chat" class ="chatAction" >
    ? ? ? ? ? ?
    < result > /UserList.jsp </ result >
    ? ? ? ?
    </ action >
    ? ?
    </ package > ? ?
    </ struts >
    清單7 classes\struts.xml

    這里的Action和平常不同的就是class屬性,它對應(yīng)于Spring所定義的bean的id,而不是它的類全名。

    最后,讓我們看看/UserList.jsp,內(nèi)容如下:

    <% @ page contentType = " text/html; charset=UTF-8 " %>
    <% @ taglib prefix = " s " uri = " /struts-tags " %>
    < html >
    < head >
    ? ?
    < title > User List </ title >
    </ head >

    < body >
    ? ?
    < h2 > User List </ h2 >
    ? ?
    < ol >
    ? ?
    < s:iterator value ="userNames" >
    ? ? ? ?
    < li >< s:property /></ li >
    ? ?
    </ s:iterator >
    ? ?
    </ ol >
    </ body >
    </ html >
    清單8 /UserList.jsp

    大功告成,分布運(yùn)行應(yīng)用程序,在瀏覽器中鍵入http://localhost:8080/Struts2_IoC/Chat.action,出現(xiàn)如圖2所示頁面:

    圖2 /ListUser.jsp
    圖2 /ListUser.jsp

    總結(jié)

    通過Spring在Struts 2上實(shí)現(xiàn)控制反轉(zhuǎn)是強(qiáng)烈推薦的做法,當(dāng)然您也可以組合其它的實(shí)現(xiàn)(如Pico等)。

    posted on 2006-12-28 17:37 Max 閱讀(33788) 評論(139)  編輯  收藏 所屬分類: Struts 2.0系列
    評論共2頁: 1 2 下一頁 

    評論:
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-04-13 10:30 | fff
    @AlleNny
    老大怎么能把借口配到配置文件里面的,接口是不能實(shí)現(xiàn)的.  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-04-18 10:51 | liujian
    你好,我也想要一份代碼,我懷疑自己的包有問題
    我的郵箱是:film911@163.com ,非常感謝  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-04-18 14:07 | liujian
    已經(jīng)調(diào)試成功,原來放錯(cuò)了一個(gè)包,謝謝您的分享  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-04-20 15:05 | look
    ????  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-04-20 15:09 | look
    誰有源碼發(fā)給我一份謝謝!cbz_com0826@163.com  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-04-21 16:24 | look
    感謝max發(fā)送的源碼包!
    原來我少導(dǎo)了一個(gè)包,struts2-spring-plugin-2.0.6,這個(gè)包是不是就是相當(dāng)也spring中的plugin的作用吧!  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-04-25 09:35 | ddd
    剛看完你的文章, 有幾點(diǎn)不太明白。。

    Action里面有chatService的setter, 和getUserName(感覺這個(gè)是否不需要)

    使用注入的方法, 是否Action里面, 就不需要對chatService進(jìn)行New啥的,

    就可以得到chatService的Instance了?  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-04-25 09:41 | ddd
    Dependency Injection 與 IoC又有什么區(qū)別呢?  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-04-27 16:28 | Max
    @ddd
    請參考Martin Fowler所寫的《Inversion of Control Containers and the Dependency Injection pattern》  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC[未登錄] 2007-04-30 05:15 | free
    不需要如此麻煩,當(dāng)你定義了setter和spring的factory,并不需要任何配置就可以析取出Spring中的bean  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC[未登錄] 2007-05-12 19:56 | lucky
    404錯(cuò)誤,有如下錯(cuò)誤提示,大家能幫看看大概是什么地方什么錯(cuò)誤嗎?謝謝了

    2007-5-12 19:40 org.apache.catalina.core.ApplicationContext log
    嚴(yán)重: Exception starting filter struts2
    Cannot locate the chosen ObjectFactory implementation: spring - [unknown location]

    ......

    2007-5-12 19:40 org.apache.catalina.core.StandardContext star
    嚴(yán)重: Error filterStart
    2007-5-12 19:40 org.apache.catalina.core.StandardContext start
    嚴(yán)重: Context startup failed due to previous errors  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-05-12 22:21 | cookie
    請教各位
    為什么把包含jar包的文件夾copy到WEB-INF/lib目錄下在Eclipse工程中顯示出來不出這些jar包來呢
    用MyEclipse建的web工程中把包含jar包的文件夾復(fù)制到lib下就可以顯示這些jar包
    那Spring包下lib文件夾下的那么多文件夾怎么才能把他們在工程下顯示出來呀?
    各位老大都是怎么解決這個(gè)問題的呀?  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-05-12 22:48 | cookie
    那個(gè)web.xml中的struts-cleanup的<filter>是做什么用的呀
    以前的教程里沒有呀
    能解釋一下嗎?謝謝  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-05-15 09:39 | Max
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-05-15 09:44 | Max
    @lucky
    應(yīng)該是沒有加struts2-spring-plugin-2.0.6.jar包  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-05-16 17:39 | zlyyi
    要是我有多個(gè)入注 怎么辦  可不可以 指定那個(gè)入注呢 謝謝 我也是初學(xué)
      回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-05-18 09:12 | Max
    @zlyyi
    “多個(gè)入注”是什么意思?你可以看看Spring框架。  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-06-06 15:19 | small.sprite
    照著寫了,可是運(yùn)行不了,能發(fā)一份源碼嗎?
    117148038@qq.com  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-06-18 17:48 | 想飛就飛
    少說了一個(gè)包 struts2-spring-plugin-2.0.6.jar
    btw:
    樓主的代碼是不是用什么工具調(diào)整過?
    < html >
    < head >
    < title > User List </ title >
    </ head >

    < > 或者 ( )兩邊都存在空格,如此工整?

    如果是的話,用什么工具調(diào)整過代碼啊?
    推薦一下,俺也用用  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-06-19 00:54 | Max
    @想飛就飛
    我沒有用任何工具,只是使用了Blogjava的“添加新隨筆”中的“插入代碼”功能。  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC[未登錄] 2007-06-19 13:18 | yang
    我的服務(wù)器 WebLogic 9.2 中總顯示:

    <2007-6-19 下午12時(shí)58分01秒 CST> <Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: org.apache.struts2.dispatcher.FilterDispatcher.
    Cannot locate the chosen ObjectFactory implementation: spring - [unknown location]
    at org.apache.struts2.config.BeanSelectionProvider.alias(BeanSelectionProvider.java:224)
    at org.apache.struts2.config.BeanSelectionProvider.alias(BeanSelectionProvider.java:195)
    at org.apache.struts2.config.BeanSelectionProvider.register(BeanSelectionProvider.java:155)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:131)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
    Truncated. see log file for complete stacktrace
    >

    我沒有你們說的 struts2-spring-plugin-2.0.6.jar

    能否發(fā)一份源碼給我,謝謝了!

      回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-06-21 20:30 | jezz
    @yang
    你的問題好像是缺少那個(gè)struts2-spring-plugin-2.0.6.jar包
    你下載那個(gè)struts2的框架時(shí)候里面帶的example!
    就有這個(gè)包你自己找找!  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC[未登錄] 2007-07-06 01:36 | xy
    上面的例子做成功后,在配置中添加了SPRING2.0的AOP,結(jié)果報(bào)以下的錯(cuò)誤:
    2007-07-06 01:26:20,218 - Caught OgnlException while setting property 'excludeMethods' on type '$Proxy7'.
    ognl.NoSuchPropertyException: $Proxy7.excludeMethods

    2007-07-06 01:26:20,218 - Caught OgnlException while setting property 'excludeMethods' on type '$Proxy8'.
    ognl.NoSuchPropertyException: $Proxy7.excludeMethods

    不知道是什么原因,請幫忙分析一下.  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC[未登錄] 2007-07-06 04:06 | xy
    在加AOP后總是出現(xiàn)如下異常,不知是何原因:
    2007-07-06 04:00:55,968 - ... initialized Struts-Spring integration successfully
    2007-07-06 04:01:08,328 - Caught OgnlException while setting property 'excludeMethods' on type '$Proxy7'.
    ognl.NoSuchPropertyException: $Proxy7.excludeMethods
    at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
    at com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:68)
    at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
    at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
    at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
    at ognl.SimpleNode.setValue(SimpleNode.java:246)
    at ognl.Ognl.setValue(Ognl.java:476)
    at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
    at com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360)
    at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
    at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:103)
    at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:90)
    at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:183)
    at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:57)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:864)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:699)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:712)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:733)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:365)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:239)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:152)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:398)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:455)
    at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:225)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:308)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:79)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3502)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4071)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:755)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:886)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:849)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1079)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:437)
    at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:2010)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-07-06 12:24 | huiyino
    我照你寫的做了一遍 。。。OK。。。
    可是我加了些Bean進(jìn)去就不行了。。。。。部署的時(shí)候出了這錯(cuò)誤。。。。
    服務(wù)器報(bào)的錯(cuò)誤部署不成功。。。。
    麻煩幫忙看看呀 。。。。

    2007-7-6 12:12:50 org.apache.struts2.spring.StrutsSpringObjectFactory <init> 信息: ... initialized Struts-Spring integration successfully 2007-7-6 12:12:50 org.apache.catalina.core.StandardContext start 嚴(yán)重: Error filterStart 2007-7-6 12:12:50 org.apache.catalina.core.StandardContext start 嚴(yán)重: Context [/Struts_spring] startup failed due to previous errors 2007-7-6 12:12:50 org.springframework.context.support.AbstractApplicationContext doClose


    struts.xml
    <action name="login" class="userLogin">
    <result>success.jsp</result>
    <result type="input">failed.jsp</result>
    </action>

    applicationContext.xml
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property>
    <property name="url"><value>jdbc:mysql://127.0.0.1:3306/usertest</value></property>
    <property name="username"><value>root</value></property>
    <property name="password"><value>123</value></property>
    </bean>
    <bean id="userBase" class="com.struts.spring.UserBase">
    <property name="dataSource">
    <ref local="dataSource"/>
    </property>
    </bean>
    <bean id="userLogin" class ="com.struts.spring.UserLogin">
    <property name ="userBase" >
    <ref local ="userBase" />
    </property >
    </bean>

    我是在搭建環(huán)境。。。。   回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-07-09 23:50 | Max
    @xy
    ognl.NoSuchPropertyException: $Proxy7.excludeMethods 你只貼出錯(cuò)誤信息,我很難判斷什么錯(cuò)誤。
    @huiyino
    我很難判斷什么錯(cuò)誤。
    Sorry!  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-07-11 10:21 | mashiguang
    見意max把需要struts2-spring-plugin-2.0.6.jar這個(gè)包也寫到文章里,不然會在啟動(dòng)是出錯(cuò),像我搞了半天才知道原來是缺這個(gè)包的緣故.
    我開始還以為是spring版本的問題.  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-07-11 22:39 | Max
    @mashiguang
    對不起,寫的時(shí)候忘了所這個(gè)包的依賴寫進(jìn)去了。  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-08-06 10:06 | jueqinguzhu
    能不能給我發(fā)份源碼啊 小弟萬分感謝
    我自己配置了好久都沒成功
    jueqinguzhu@yahoo.com.cn  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-08-07 14:26 | jueqinguzhu
    MAX先生:
    謝謝你的代碼,為什么要在ACTION里面加上private static final long serialVersionUID = 8445871212065L 呢?  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-08-07 14:34 | jueqinguzhu
    而且這個(gè)serialVersionUID是可以自動(dòng)生成,還是自己隨意寫的一個(gè)LONG值  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-08-07 16:03 | shengguolong
    404錯(cuò)誤,我看了下,工程起不來。。。
    能否發(fā)一份源碼,十分感謝!!!
    郵箱:long2317479@gmail.com  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-08-08 09:31 | pn2007
    請發(fā)份源碼,謝謝! sailsoft@tom.com.  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-08-08 09:36 | Max
    @jueqinguzhu
    serialVersionUID用于串行化(Serialize)對象時(shí),加上標(biāo)識。我是使用Eclipse生成的值。  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-08-08 14:44 | liy
    你好!Max大哥,我運(yùn)行Struts 2中實(shí)現(xiàn)Ioc的例子老是報(bào)404錯(cuò)誤.
    能否發(fā)一份你的源碼給我比較一下?
    我的郵箱是followmephoe@yahoo.com.cn謝謝  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-08-09 21:46 | shengguolong
    我發(fā)現(xiàn)我的每個(gè)struts2+spring+hibernate都有這個(gè)問題,我有把spring-web.jar這個(gè)包加進(jìn)去啊,郁悶了。
    能否幫我解答下。。。多謝了!!!
    2007-8-9 21:37:42 org.apache.catalina.core.StandardContext listenerStart
    嚴(yán)重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    at org.springframework.web.context.ContextLoader.<init>(ContextLoader.java:145)
    at org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:57)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4336)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:589)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    2007-8-9 21:37:42 org.apache.catalina.core.StandardContext start
    嚴(yán)重: Error listenerStart  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-08-20 13:15 | edzhh
    能否發(fā)我一份,我的配置后站點(diǎn)總是啟動(dòng)不了,我的郵箱是:edzhh@163.com,
    Thank you!
      回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-08-20 16:39 | edzhh
    haha,我的問題:
    java.lang.SecurityException: class "org.apache.commons.collections.SequencedHashMap"'s signer information does not match signer information of other classes in the same package
    解決了,原因是:我的cglib-2.1.3.jar和hibernate3.jar兩個(gè)文件是在MyEclipse6.0下自動(dòng)生成的,只要在MyEclipse5.0或5.5下生成拷貝到工程下覆蓋掉6.0下生成的就是了.  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-08-27 09:00 | sshzhangwg
    大哥,你把你的文章整理下,出本書,可能對整個(gè)軟件行業(yè)的幫助會更大些。  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-09-17 15:19 | sanjin2482
    我也發(fā)現(xiàn)了問題--可否也給我發(fā)份源代碼---sanjin2482@sina.com.cn
    x謝謝!!  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC[未登錄] 2007-09-18 13:35 | yingjie
    max兄,看了你的文章十分收益,有個(gè)問題想請教一下,就是把struts1.2的項(xiàng)目改成struts2.0,請問要注意哪些方面啊?還有就是action要怎么寫合適,沒有了ActionForm那么數(shù)據(jù)存放到action中要怎么存啊?總之就是有很多的問題要請教你,希望你能教我,我的郵箱是yingjie853@163.com,MSN:yingjie_853@hotmail.com
    QQ:278537061,希望能和你交流一下
      回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-09-30 12:06 | origo
    @shengguolong
    你的錯(cuò)誤是沒有添加commons logging的jar  回復(fù)  更多評論
      
    # 學(xué)習(xí)過程中也出現(xiàn)這種提示,請問什么原因?[未登錄] 2007-09-30 15:26 | Spring
    學(xué)習(xí)過程中也出現(xiàn)這種提示,請問什么原因?
    嚴(yán)重: Exception starting filter struts2
    Cannot locate the chosen ObjectFactory implementation: spring - [unknown location]
    at org.apache.struts2.config.BeanSelectionProvider.alias(BeanSelectionProvider.java:223)
    at org.apache.struts2.config.BeanSelectionProvider.alias(BeanSelectionProvider.java:194)
    at org.apache.struts2.config.BeanSelectionProvider.register(BeanSelectionProvider.java:153)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:131)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
    at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4340)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)  回復(fù)  更多評論
      
    # 學(xué)習(xí)過程中也出現(xiàn)這種提示,請問什么原因?[未登錄] 2007-09-30 15:33 | Spring
    @lucky
    我也碰到這種問題?請問你是如何解決的?
    嚴(yán)重: Exception starting filter struts2
    Cannot locate the chosen ObjectFactory implementation: spring - [unknown location]
    at org.apache.struts2.config.BeanSelectionProvider.alias(BeanSelectionProvider.java:223)
    at org.apache.struts2.config.BeanSelectionProvider.alias(BeanSelectionProvider.java:194)
    at org.apache.struts2.config.BeanSelectionProvider.register(BeanSelectionProvider.java:153)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:131)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-10-09 15:57 | sanjin
    同志們:
    我也發(fā)現(xiàn)了問題--可否也給我發(fā)份源代碼---sanjin2482@sina.com.cn  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-11-06 21:18 | Cowboy
    想請教一個(gè)小問題:
    在Web.xml文件里,下面的代碼有什么作用?
    < filter >
    < filter-name > struts-cleanup </ filter-name >
    < filter-class >
    org.apache.struts2.dispatcher.ActionContextCleanUp
    </ filter-class >
    </ filter >

    < filter-mapping >
    < filter-name > struts-cleanup </ filter-name >
    < url-pattern > /* </ url-pattern >
    </ filter-mapping >

    我只是知道,filter與filter-mapping是通過filter-name來對應(yīng)起來的。  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-11-23 12:59 | 謝謝大哥指導(dǎo)
    謝謝大哥指導(dǎo)謝謝大哥指導(dǎo)謝謝大哥指導(dǎo)
      回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-11-26 12:21 | ryou

    我也碰到這種問題?請問你是如何解決的?
      回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-11-26 12:22 | ryou
    我也碰到這種問題?請問你是如何解決的?
    at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:206)
    at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:57)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:905)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:743)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:756)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:777)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:410)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:239)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:152)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-11-26 12:27 | ryou
    不知是何原因:
    at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:206)
    at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:57)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:905)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:743)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:756)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:777)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:410)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:239)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:152)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
    at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3696)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC[未登錄] 2007-12-04 22:40 | haha~~~~
    寫的不錯(cuò),都是我想要的,謝謝。  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-12-27 20:43 | way

    max:
    我的可以出來.jsp頁面
    但是卻顯示不出iterator標(biāo)簽內(nèi)的內(nèi)容 代碼跟你的一樣啊 請問怎么回事   回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2007-12-27 20:51 | way
    我想要一份源代碼 謝謝
    郵箱是86322989@qq.com  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-01-04 10:17 | fgfggf
    gfdgfdg  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-01-04 13:29 | 小徐
    嚴(yán)重: Exception starting filter struts2
    Cannot locate the chosen ObjectFactory implementation: spring - [unknown location]

    少放了個(gè)包struts2-spring-plugin-2.0.11.jar

      回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC[未登錄] 2008-01-07 12:02 | jet
    @小徐
    嚴(yán)重: Exception starting filter struts2
    Cannot locate the chosen ObjectFactory implementation: spring - [unknown location]

    少放了個(gè)包struts2-spring-plugin-2.0.11.jar
      回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-01-08 17:04 | ardy
    參照另一個(gè)實(shí)例寫了一個(gè),可是訪問action就總是404,嘗試在那個(gè)實(shí)例里訪問他的action,也是404,但是那個(gè)實(shí)例的jsp實(shí)面卻能用ajax正常訪問到。不知道為什么?請指教一下。另請發(fā)一份源碼給我,謝謝 ardy.studio@163.com  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-01-29 10:55 | xiluoshen
    我也遇到問題,實(shí)在調(diào)試不過去了,請也給我發(fā)一份代碼,非常感謝!  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-01-29 10:55 | xiluoshen
    我的郵箱是xiluoshen@163.com  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-02-03 14:59 | 驍勇
    我的所有的配置和上面的描述的都是一樣的,可是最終還是沒有成功!
    嚴(yán)重: Error filterStart
    2008-2-3 14:50:42 org.apache.catalina.core.StandardContext start
    嚴(yán)重: Context [/struts_loc] startup failed due to previous errors
    2008-2-3 14:50:43 org.apache.coyote.http11.Http11BaseProtocol start

    請問各位大哥。是怎么回事啊。如果誰有寫好的,可以運(yùn)行的例子給我共享以下可以嗎?我的郵箱: xiaoyong601@163.com   回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-02-03 15:03 | 驍勇
    很想找一些正在研究2.0的朋友交流以下

    我的msn:xiaoyong_601@hotmail.com

    QQ:274474040  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-02-09 21:22 | mycoy
    我也是404錯(cuò)誤,想要您的源碼,zw_z7@hotmail.com.
    多謝了。  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-02-14 15:25 | 驍勇
    @驍勇
    該問題已經(jīng)解決,是因?yàn)榘嬷魃賹懥艘粋€(gè)包
    struts2-spring-plugin-2.0.11.jar  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-02-29 15:48 | dyw31415926
    哪位朋友有該例子的源碼的,麻煩發(fā)一份到我郵箱好嗎?
    dyw31415926@163.com
    謝謝  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-03-04 23:44 | Dechengtju
    請問MAX先生,我照著您的代碼做了一遍,為什么運(yùn)行時(shí)報(bào)如下錯(cuò)誤
    我的郵箱是 dechengtju@yahoo.com.cn
    嚴(yán)重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    java.lang.NoSuchMethodError: org.springframework.beans.factory.config.ConfigurableListableBeanFactory.registerResolvableDependency(Ljava/lang/Class;Ljava/lang/Object;)Vat org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.postProcessBeanFactory(AbstractRefreshableWebApplicationContext.java:162)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:331)at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-03-18 11:37 | hnliqinpeng
    org.apache.catalina.core.StandardContext listenerStart
    嚴(yán)重的: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanDefinitionStoreException: Line 4 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".
    org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".

    Struts2+ spring2.0 + hibernate3
    我的 程序 也是 出 這個(gè)問題 ,調(diào)了 幾天 也沒有 好.
    請 老師 指導(dǎo). 我的 郵箱: hnliqinpeng@163.com  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC[未登錄] 2008-03-25 18:49 | Robin
    非常感謝Max先生,我正在學(xué)習(xí)這個(gè)框架技術(shù).您能將原代碼發(fā)到我郵箱里一份嗎?zhangyuming422@126.com  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-04-01 12:56 | 金昌
    謝謝Max,我也想要一份
    yjc121@163.com  回復(fù)  更多評論
      
    # spsbedlm 2008-04-02 08:30 | spsbedlm
    mimmihnd http://fiqqjytt.com vaoilxat zqtpqfey  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-04-02 11:56 | jc
    謝謝MAX 我也想要一份  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-04-02 12:01 | jc
    郵箱:owenchao_121@163.com  回復(fù)  更多評論
      
    # 同樣的問題 404 錯(cuò)誤 2008-04-23 13:32 | alan
    我訪問不了jsp頁面 報(bào)404 錯(cuò)誤, 并且在后臺報(bào)
    2008-4-23 13:04:53 org.apache.catalina.core.StandardContext start
    嚴(yán)重: Error filterStart
    2008-4-23 13:04:53 org.apache.catalina.core.StandardContext start
    嚴(yán)重: Context startup failed due to previous errors

    各位大蝦們請指點(diǎn),請問是什么原因?我的郵箱是:285330436@qq.com  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC[未登錄] 2008-05-08 18:34 | andy
    謝謝Max,我也想要一份原代碼
    like.hao@ge.com
    Thanks  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-06-13 16:00 | hover
    @yangdamao
    @Max
    兩位大哥,這個(gè)spring的例子始終跳不出來,出錯(cuò)信息是:嚴(yán)重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanDefinitionStoreException: Line 4 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".
    org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".


    我的郵箱:sxliang_531@163.com
    能發(fā)份源碼嗎?
    多謝了!  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-06-13 16:29 | hover
    問題解決了, 我估計(jì)是因?yàn)槲覍?dǎo)入的一些jar包是spring1.2下的,所以會出錯(cuò)。  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-06-25 12:29 | Kuzi
    前輩,我寫的報(bào)錯(cuò)!
    是否有時(shí)間把源碼發(fā)給我一下.小弟在這謝了.

    Email: 153642484@qq.com  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC[未登錄] 2008-07-09 11:50 | 1
    sdfdsf  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-07-11 14:12 | godo
    測試可用  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-07-24 15:11 | mozart
    max先生
    能給我發(fā)個(gè)么 或者手上有成功的給我發(fā)個(gè)
    我的總是項(xiàng)目不能運(yùn)行
    mozart@vip.qq.com  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-09-09 18:55 | ffgames
    把struts.xml分成二個(gè)文件,action會有找不到的問題。是不是要把新加入的文件在哪里配置一下。請指教。
    ffgames@163.com  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-09-10 16:58 | 木瓜
    tutorial.ChatAction.java
    類中少了 如下方法,找了好久才發(fā)現(xiàn)!希望BZ改正以下,以免讓他人再走轉(zhuǎn)路。
    public Set<String> getUserNames() {
    return userNames;
    }  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-09-18 15:08 | sebatinsky
    希望哪位好心的給我傳一份,怎么做都有錯(cuò),自己雖然發(fā)現(xiàn)少了前面說的那個(gè)包,但是后來加上之后又出錯(cuò)了,研究了好久還是不行,
    警告: Settings: Could not parse struts.locale setting, substituting default VM locale
    2008-9-18 15:03:03 org.apache.catalina.core.StandardContext filterStart
    嚴(yán)重: Exception starting filter struts2
    java.lang.NoClassDefFoundError: Lcom/opensymphony/xwork2/util/logging/Logger;
    at java.lang.Class.getDeclaredFields0(Native Method)
    at java.lang.Class.privateGetDeclaredFields(Class.java:2291) at java.lang.Class.getDeclaredFields
    2008-9-18 15:03:03 org.apache.catalina.core.StandardContext start
    嚴(yán)重: Error filterStart
    2008-9-18 15:03:03 org.apache.catalina.core.StandardContext start
    嚴(yán)重: Context [/ioc] startup failed due to previous errors
    2008-9-18 15:03:03 org.apache.catalina.core.ApplicationContext log

    我知道上面肯定沒有那個(gè)class,但是不知道為什么會報(bào)這樣的錯(cuò)誤,  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-09-18 15:09 | sebatinsky
    sebatinsky@163.com
    都忘記說郵箱了,哪位好心的傳一份給我,謝謝  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-09-18 15:12 | sebatinsky
    而且我一把struts.xml和properties文件放到classes下面就會編譯就會消失,不知道是為什么.哎,  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-10-08 16:06 | ahaiyg
    @sebatinsky
    你得將它們放到src目錄下,那樣就不會消失了  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-10-10 11:25 | neusoft_fool
    我作spring也 遇到這個(gè)問題了 我怎么改不好使 我不活了
      回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC[未登錄] 2008-11-20 10:44 | 啊啊
    我也要源代一份阿
    bobliuwei@hotmail.com
    嘎嘎  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2008-12-09 16:10 | hjtu
    致命的: Context initialization failed
    java.lang.NoClassDefFoundError: org/springframework/core/SmartClassLoader
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    .................

    E-Mail:javasir2007@qq.com
    能發(fā)一份source嗎?
      回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2009-01-19 12:35 | shuzigui
    你好!我想請問一下,我的配置跟你的一樣,包也是下載你所說的哪些包,并加載到了工程里面,但是運(yùn)行不起來,就連UserList.jsp也出現(xiàn)HTTP Status 404 -錯(cuò)誤,Chat.action也是出現(xiàn)同類錯(cuò)誤。能幫我解釋一下原因嗎  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2009-02-17 16:49 | Andy_long
    應(yīng)該是 struts.xml配置文件里 弄錯(cuò)了 這么寫試試 :
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

    <struts>
    <include file ="struts-default.xml"/>

    <package name="struts2_IoC" extends="struts-default">
    <action name="Chat" class="tutorial.ChatAction">
    <result>UserList.jsp</result>
    </action>
    </package>
    </struts> @shuzigui
      回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2009-02-18 10:17 | Andy_long
    樓主 為什么 我的jsp頁面 刷新的時(shí)候 只出現(xiàn)了 一個(gè)“1.”后面沒有內(nèi)容了
    還請樓主有時(shí)間的時(shí)候 幫我解決一下  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2009-03-20 10:41 | linice
    尊敬的Max,我已經(jīng)花了快3天時(shí)間,整這個(gè)程序了,遺憾的是一直沒有結(jié)果。
    所以,還想麻煩你給我發(fā)一份源代碼,不過,請發(fā)到csdn.net上去好么?
    因?yàn)椋覄倢?shí)習(xí),在公司里面是對外部郵箱禁止的。
    外部郵件也同樣禁止。  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2009-04-21 00:24 | 葛珂
    我的跟你一樣,沒有反應(yīng),郁悶。。@shuzigui
      回復(fù)  更多評論
      
    # Action class [chatAction] not found錯(cuò)誤![未登錄] 2009-05-13 16:12 | phoenix
    嚴(yán)重: Exception starting filter struts2
    Action class [chatAction] not found - action - file:/D:/tomcat-6.0.18/webapps/Struts2_IoC/WEB-INF/classes/struts.xml:7:42
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:374)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:329)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:429)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:239)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:152)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
    at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    2009-5-13 16:07:23 org.apache.catalina.core.StandardContext start
    嚴(yán)重: Error filterStart
    2009-5-13 16:07:23 org.apache.catalina.core.StandardContext start
    嚴(yán)重: Context [/Struts2_IoC] startup failed due to previous errors
    2009-5-13 16:07:23 org.apache.catalina.core.ApplicationContext log  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2009-05-15 11:06 | miaomiao
    還是直接使用Spring,比較容易理解。  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2009-07-16 18:46 | struts
    嚴(yán)重: Context initialization failed
    java.lang.NoClassDefFoundError: org/springframework/core/SmartClassLoader
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1850)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:890)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1354)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getDeclaredConstructor(Class.java:1985)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:62)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:249)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Caused by: java.lang.ClassNotFoundException: org.springframework.core.SmartClassLoader
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    ... 31 more
    2009-7-16 18:39:28 org.apache.catalina.core.StandardContext listenerStart
    Max先生為什么我按你寫的做總會出現(xiàn)上面的錯(cuò)誤,可以發(fā)份源碼給我嗎,我的郵箱:qinshengliao@163.com  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2009-08-29 11:01 | 白雪峰
    我也碰到了上面的問題,能不能把源代碼發(fā)我一份。
    baimimi@126.com
    謝謝  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2009-11-08 13:01 | 莫名其妙
    博主知道什么叫IOC嗎? 難道IOC就是依賴注入?  回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC 2009-12-14 10:10 | dj861212
    跟著做實(shí)驗(yàn),發(fā)現(xiàn)了這個(gè)問題,其實(shí)這樣寫就對了,為什么,嘻嘻,我就不知道了

    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    <init-param>
    <param-name>actionPackages</param-name>
    <param-value>org.springside.examples.miniweb.web</param-value>
    </init-param>
    </filter>
      回復(fù)  更多評論
      
    # re: 在Struts 2中實(shí)現(xiàn)IoC[未登錄] 2010-11-14 17:20 |
    @Max
    I TOO.I WANT. BUT .TODAY IS NOV 14,2010  回復(fù)  更多評論
      
    評論共2頁: 1 2 下一頁 
    主站蜘蛛池模板: 在线亚洲精品自拍| 亚洲欧洲专线一区| 一级一看免费完整版毛片| 无码国产精品一区二区免费I6| 精品国产人成亚洲区| 亚洲日韩国产二区无码| 一级毛片在线免费看| 国产日产亚洲系列最新| 亚洲国产一区二区三区在线观看 | 国产小视频在线免费| 亚洲美女免费视频| 99精品视频免费| 亚洲av无码国产精品色在线看不卡 | 91免费人成网站在线观看18| 亚洲一区二区三区在线播放| 亚洲精品永久在线观看| 午夜性色一区二区三区免费不卡视频| 亚洲区小说区图片区QVOD| 国产亚洲精品成人久久网站| 岛国av无码免费无禁网站| 久久久久亚洲AV无码专区体验| 中国国产高清免费av片| 亚洲国产成人久久综合区| 亚洲av日韩精品久久久久久a| 波多野结衣在线免费观看| 亚洲视频在线免费看| 在线观看肉片AV网站免费| 中文字幕亚洲日本岛国片| 老司机午夜在线视频免费| 国产成人高清精品免费鸭子| 亚洲日韩国产精品乱-久| 国产四虎免费精品视频| 亚洲一区免费观看| 日韩精品在线免费观看| 亚洲av中文无码乱人伦在线r▽| 成人av片无码免费天天看| 亚洲人成电影在线播放| 男人和女人高潮免费网站| 又粗又黄又猛又爽大片免费| 亚洲sm另类一区二区三区| 精品无码国产污污污免费|