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

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

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

    將Java進行到底
    將Java進行到底
    posts - 15,  comments - 66,  trackbacks - 0

    這兩天嘗試整合一下Acegi、Spring和Struts。配置文件如下:
    web.xml文件內容詳細:



    ?Acegi Sample Application

    ?
    ?
    ??contextConfigLocation
    ??
    ???/WEB-INF/applicationContext.xml
    ???/WEB-INF/applicationContext-acegi.xml
    ??

    ?

    ?
    ??log4jConfigLocation
    ??/WEB-INF/classes/log4j.properties
    ?

    ?
    ?
    ??Acegi Filter Chain Proxy
    ??
    ???net.sf.acegisecurity.util.FilterToBeanProxy
    ??

    ??
    ???targetClass
    ???
    ????net.sf.acegisecurity.util.FilterChainProxy
    ???

    ??

    ?

    ?
    ??Acegi Filter Chain Proxy
    ??/*
    ?

    ?
    ?
    ??
    ???org.springframework.web.context.ContextLoaderListener
    ??

    ?

    ?
    ??
    ???org.springframework.web.util.Log4jConfigListener
    ??

    ?

    ?


    ?

    ?
    ??action
    ??
    ???org.apache.struts.action.ActionServlet
    ??

    ??
    ???config
    ???/WEB-INF/struts-config.xml
    ??

    ??
    ???debug
    ???3
    ??

    ??
    ???detail
    ???3
    ??

    ??0
    ?

    ?
    ??action
    ??*.do
    ?


    spring的配置文件我分為兩個:
    一個是applicationContext.xml,配置了spring整合Hibernate的部分,包括Datasource和DAO部分,內容如下:


    ???class="org.apache.commons.dbcp.BasicDataSource"
    ??destroy-method="close">
    ??
    ???com.mysql.jdbc.Driver
    ??

    ??
    ???jdbc:mysql://localhost/lcdis
    ??

    ??
    ???root
    ??

    ??
    ???
    ??

    ?

    ???class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    ??
    ???
    ????com/laf/bo/Example.hbm.xml
    ???

    ??

    ??
    ???
    ????
    ?????org.hibernate.dialect.MySQLDialect
    ????

    ????true
    ????
    ?????true
    ????

    ???

    ??

    ??
    ???
    ??

    ?

    ???class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    ??
    ???
    ??

    ?

    ???class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    ??
    ???
    ??

    ??
    ???
    ??

    ??
    ???
    ????
    ?????PROPAGATION_REQUIRED,readOnly,-BusinessException
    ????

    ????
    ?????PROPAGATION_REQUIRED,-BusinessException
    ????

    ????
    ?????PROPAGATION_REQUIRED,-BusinessException
    ????

    ????
    ?????PROPAGATION_REQUIRED,-BusinessException
    ????

    ???

    ??

    ?

    ???class="com.laf.bd.BusinessServiceImpl">
    ??
    ???
    ??

    ?

    ?
    ??
    ???
    ??

    ?




    另外一個.xml,配置了Acegi相關內容:

    ?
    ?

    ?
    ???class="net.sf.acegisecurity.util.FilterChainProxy">
    ??
    ???
    ????CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
    ????PATTERN_TYPE_APACHE_ANT
    ????/**=httpSessionContextIntegrationFilter,authenticationProcessingFilter,?securityEnforcementFilter
    ???

    ??

    ?

    ???class="net.sf.acegisecurity.ui.webapp.AuthenticationProcessingFilter">
    ??
    ???
    ??

    ??
    ???/login.jsp
    ??

    ??
    ???/
    ??

    ??
    ???/j_acegi_security_check.do
    ??

    ?

    ???class="net.sf.acegisecurity.providers.ProviderManager">
    ??
    ???
    ????
    ???

    ??

    ?


    ???class="net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider">
    ??
    ???
    ??

    ??
    ???
    ??

    ??
    ?

    ???class="net.sf.acegisecurity.providers.dao.jdbc.JdbcDaoImpl">
    ??
    ???
    ??

    ?

    ???class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" />
    ???class="org.springframework.cache.ehcache.EhCacheFactoryBean">
    ??
    ???
    ??

    ??
    ???userCache
    ??

    ?

    ???class="net.sf.acegisecurity.providers.dao.cache.EhCacheBasedUserCache">
    ??
    ???
    ??

    ?

    ???class="net.sf.acegisecurity.providers.encoding.Md5PasswordEncoder">
    ?

    ???class="net.sf.acegisecurity.providers.anonymous.AnonymousProcessingFilter">
    ??
    ???foobar
    ??

    ??
    ???anonymousUser,ROLE_ANONYMOUS
    ??

    ?

    ???class="net.sf.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider">
    ??
    ???foobar
    ??

    ?

    ???class="net.sf.acegisecurity.context.HttpSessionContextIntegrationFilter">
    ??
    ???
    ????net.sf.acegisecurity.context.security.SecureContextImpl
    ???

    ??

    ?

    ?

    ???class="net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter">
    ??
    ???
    ??

    ??
    ???
    ??

    ?

    ?
    ???class="net.sf.acegisecurity.vote.AffirmativeBased">
    ??
    ???false
    ??

    ??
    ???
    ????
    ???

    ??

    ?

    ?
    ???class="net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor">
    ??
    ???
    ??

    ??
    ???
    ??

    ??
    ???
    ????CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
    ????PATTERN_TYPE_APACHE_ANT
    ????/index.jsp=ROLE_SUPERVISOR
    ????/hello.jsp=ROLE_TELLER
    ????/*.do=ROLE_TELLER
    ???

    ??

    ?

    ???class="net.sf.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint">
    ??
    ???/login.jsp
    ??

    ??
    ???false
    ??

    ?




    注意兩處顏色不同的部分配置,是Acegi需要配合struts的內容。

    Spring的配置我這里就不詳細描述,這里主要談談對Acegi的看法。

    我用的是Acegi0.8.3,目前是最新版。可以到項目主頁下載:http://acegisecurity.sourceforge.net/?

    各位也看到了,Acegi的配置還是比較復雜,要了解幾個主要的類,如下圖:

    applicationContext-acegi.jpg

    如果嫌麻煩,就直接拷貝過去使用就可以了。只要修改objectDefinitionSource部分的權限配置就行。

    再附上登錄頁面login.jsp的片斷:

    ???
    ??? ?
    ??? ??
    ??? ?
    ??? ?
    ??? ??
    ??? ?
    ??? ?
    ??? ??
    ??? ?
    ???

    ??? ???User:
    ??? ??

    ??? ???Password:
    ??? ??

    ??? ???
    ??? ??

    ???


    粗淺研究,首次涂鴉,希望有些可以供人參考之處,上面內容有很多寫的不夠詳盡,各位看官可以留言,或發郵件共同探討。

    posted on 2005-10-27 00:06 風蕭蕭 閱讀(1868) 評論(5)  編輯  收藏 所屬分類: 原創

    FeedBack:
    # re: 整合前臺技術acegi+spring+struts
    2006-12-25 22:42 | yesterday
    現實不正常啊,能正常顯示全部內容么?我現在正在做這樣的一個東西,急需指導,希望能得到你的代碼參考下,謝謝!
    20030704107@cs2.swfc.edu.cn  回復  更多評論
      
    # 我有意見。。。
    2007-03-13 11:49 | 周潤發的大哥
    我有意見。。。
    文章看不清楚,沒有參考價值啊!
    請您再整理一下,ok ?
    謝謝您了!
    交個朋友吧!qq:316451618  回復  更多評論
      
    # re: 整合前臺技術acegi+spring+struts
    2008-04-22 13:47 | waterloovx
    貼出來了,但是不容易看,能不能整理一下呢?這樣的文章參考價值不大  回復  更多評論
      
    # re: 整合前臺技術acegi+spring+struts
    2008-09-19 13:56 | ss
    你真的沒必要忒出來,寫得文章比較差,不過也許你技術很牛  回復  更多評論
      
    # re: 整合前臺技術acegi+spring+struts
    2008-09-19 13:56 | ss
    看來你也不更新自己的blog  回復  更多評論
      

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     

    <2008年9月>
    31123456
    78910111213
    14151617181920
    21222324252627
    2829301234
    567891011

    常用鏈接

    留言簿(8)

    隨筆分類

    隨筆檔案

    文章分類

    文章檔案

    相冊

    收藏夾

    myfriends

    opensource

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 免费无码黄网站在线观看| 中文字幕免费视频| 日本免费一区二区三区最新| 亚洲二区在线视频| 久久午夜免费视频| 亚洲欧美黑人猛交群| 最近中文字幕mv免费高清视频7| 亚洲一区二区三区深夜天堂| 无码国产精品一区二区免费| 国产亚洲sss在线播放| 黄色成人网站免费无码av| 亚洲中文字幕无码中文字| 麻豆国产入口在线观看免费 | 日本免费一区二区三区| 亚洲色图在线播放| av无码久久久久不卡免费网站| 亚洲中文久久精品无码1 | 日韩成人免费在线| 免费激情网站国产高清第一页| 亚洲欧洲国产成人综合在线观看 | 日韩一区二区a片免费观看| 亚洲人xxx日本人18| 国产精品自在自线免费观看| 免费的黄网站男人的天堂| 亚洲欧洲∨国产一区二区三区 | 亚洲s码欧洲m码吹潮| 亚洲成?v人片天堂网无码| 好男人资源在线WWW免费| 亚洲视频在线观看一区| 最近高清国语中文在线观看免费| 亚洲av午夜国产精品无码中文字 | 免费国产美女爽到喷出水来视频| 一级女人18片毛片免费视频| 日本红怡院亚洲红怡院最新| h视频在线观看免费完整版| 亚洲精品久久久久无码AV片软件| 国产亚洲一区二区三区在线不卡| 182tv免费观看在线视频| 爱情岛论坛亚洲品质自拍视频网站 | 好先生在线观看免费播放| 日产久久强奸免费的看|