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

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

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

    [原創(chuàng)]使用Acegi時獲取用戶信息的幾個函數(shù)

    Acegi框架通過ThreadLocal存放用戶信息,因此可以通過以下函數(shù)獲取相關(guān)信息:

      /**
       * 取得當(dāng)前用戶名
       * 
    @return
       
    */

      
    public static String getUsername(){
        Context context
    =ContextHolder.getContext();
        
    if(context!=null){
          
    if(context instanceof SecureContext){
            SecureContext sc
    =(SecureContext)context;
            Authentication auth
    =sc.getAuthentication();
            
    if(auth!=null){
              Object principal
    =auth.getPrincipal();
              
    if(principal instanceof UserDetails) {
                
    return ((UserDetails)principal).getUsername();
              }
    else{
                
    return principal.toString();
              }

            }

          }

        }

        
    return null;
      }

      
    /**
       * 取得當(dāng)前用戶密碼
       * 
    @return
       
    */

      
    public static String getPassword(){
        Context context
    =ContextHolder.getContext();
        
    if(context!=null){
          
    if(context instanceof SecureContext){
            SecureContext sc
    =(SecureContext)context;
            Authentication auth
    =sc.getAuthentication();
            
    if(auth!=null){
              Object principal
    =auth.getPrincipal();
              
    if(principal instanceof UserDetails) {
                
    return ((UserDetails)principal).getPassword();
              }
    else{
                
    return null;
              }

            }

          }

        }

        
    return null;
      }

      
    /**
       * 取得當(dāng)前用戶session id
       * 
    @return sessionid or null
       
    */

      
    public static String getSessionID(){
        Context context
    =ContextHolder.getContext();
        
    if(context!=null){
          
    if(context instanceof SecureContext){
            SecureContext sc
    =(SecureContext)context;
            Authentication auth
    =sc.getAuthentication();
            
    if(auth!=null){
              Object details
    =auth.getDetails();
              
    if(details instanceof WebAuthenticationDetails) {
                
    return ((WebAuthenticationDetails)details).getSessionId();
              }
    else{
                
    return null;
              }

            }

          }

        }

        
    return null;
      }

    posted @ 2006-03-03 16:17 一餐三碗 閱讀(2813) | 評論 (4)編輯 收藏

    [轉(zhuǎn)載]可重用的AJAX 控件(AJAX Widgets)列表

    出處:

    http://www.maxkiesler.com/index.php/weblog/comments/downloadable_web_20_and_ajax_widgets1/

    Downloadable Web 2.0 and AJAX Widgets

    image It seems as though every other day a new web 2.0 or AJAX widget comes to the attention of del.icio.us or Google. Many user interface elements lend themselves to being "ajaxified". Calendars, image galleries, contact forms and auto-complete search functions are currently very popular. The problem is how to find working and downloadable examples. This post is an attempt to provide a list of the current best of the best web 2.0 and AJAX widgets that can be downloaded and integrated into your website.


    I've been looking at AJAX widgets for about six months now through my own site mHub so these are ones 've downloaded and installed so I've made sure they are understandable by the average designer or developer.

    Before you use the following widgets, it would be a good idea to read the following articles. These articles will guide you on what to do and what not to do with AJAX. Have fun. : )

    Jeffrey Veen posts: Designing for the subtlety of Ajax

    Increasing the Strength of Ajax
    Alex Bosworth posts Ajax Mistakes

    AJAX: Image Galleries
    Zen Photo
    One of the nicest and most complete image gallery with AJAX functions. Features include uploading, comments, AJAX-powered edit-while-you-browse, and a theme engine.

    AJAX Image Gallery Example - Alpha Release
    Both of these are extreme alpha developer releases. These two examples are really mash-ups of existing code to show what is possible.

    AJAX Calendars
    Monket Calendar
    An Ajax enabled online calendar. Drag and drop events to change dates, drag the start/end of an event to create multi-day events, create and edit events without refreshing the page, all with an iCal style interface.The current release works in all major browsers (Firefox, Opera, Safari, and Internet Explorer). IE support still has a few bugs, namely the previous/next month links not working, and the need to click on a multi-day event before you can resize it.

    AJAX Contact Forms
    Dustin's Ajax Contact Form
    At this point this is probably the most used AJAX contact form on the web. I first found it right after he first made one for himself and announced it but had no download or documentation. Now he has a nice page devoted to his easy to use AJAX contact form with a download and documentation.

    AJAX and PHP Form Processing
    This is a nice tutorial, with example file that shows you how to make a php contact form with some easy to understand AJAX effects from Scriptaculous.

    The Zapatec AJAX Forms
    Very nicely executed forms with a stripped down free download. These forms, "perform validation, provide feedback, and display error messages that enrich the user's experience while reducing the communications with the server behind the scenes." The paid versions have some amazing functionality.

    Ajax Keyword Suggest
    Ajax Keyword Suggest Demo
    Want to add Keyword Suggest functionality into your site without installing new software? No Problem. Simply Login to ajaxed.com and create and customize your own Keyword Suggest List. All you have to do is copy and paste a small piece of code into your html page and you'll have the feature running instantly.

    Ajax Suggest box for HTML Forms
    Tutorial explaining how to use Ajax (Asynchronous Javascript and XML) to create a drop-down 'suggest' box for form fields which updates as you type by querying the server in the background. Similar to the 'Google Suggest' application. Full tutorial, code snippets and further reources.

    AJAX Login Systems
    Creating a secure login system using XMLHttpRequest
    This is an example of a login system that does not require page refreshes, but is still very secure.

    AJAX Slideshows
    AJAX Slideshow
    It resizes, it transitions, it fades in and out and it's not flash! The new AJAX slideshow on the homepage of my site comes to you courtesy of Scott Upton at Uptonic.

    AJAX Surveys
    Asynchronous Polling
    This example shows how you can use AJAX to do server-side polling without to update page data without a page refresh.

    Tabbed AJAX Websites
    Make an AJAX Website in Less than 10 Minutes
    I've been toying around with AJAX apps and XMLHttpRequest but have wanted to put up a site that loads all of its content asynchronously. If you're like me and you learn best from working with examples you're only 10 minutes away from your first AJAX website.

    Ajax Project - Tabbed Page Interface

    There are quite a few Javascript implementations of tabbed interfaces out there on the web. How much better, though, to be able to change from pagetab to pagetab without a page refresh? Here's an example of a tabbed interface using Ajax to load the new pages.

    posted @ 2006-02-09 09:24 一餐三碗 閱讀(1278) | 評論 (0)編輯 收藏

    [轉(zhuǎn)載]How to get (almost) 3 GB heap on Windows!

    介紹如何使用JRockit 5.0 R26突破2G的單進(jìn)程應(yīng)用程序應(yīng)用內(nèi)存限制(最大能擴(kuò)大到3.85 GB )

    原文:http://dev2dev.bea.com/blog/hstahl/archive/2005/12/how_to_get_almo.html
    posted @ 2005-12-08 11:38 一餐三碗 閱讀(990) | 評論 (0)編輯 收藏

    [原創(chuàng)]實戰(zhàn)Acegi:使用Acegi作為基于Spring框架的WEB應(yīng)用的安全框架

    實戰(zhàn)Acegi:使用Acegi作為基于Spring框架的WEB應(yīng)用的安全框架

    最近項目使用Acegi作為安全框架的實現(xiàn),效果不錯,就寫了這篇文章作為總結(jié).

    對于任何一個完整的應(yīng)用系統(tǒng),完善的認(rèn)證和授權(quán)機(jī)制是必不可少的。在基于SpringFramework的WEB應(yīng)用中,
    我們可以使用Acegi作為安全架構(gòu)的實現(xiàn)。本文將介紹如何在基于Spring構(gòu)架的Web應(yīng)用中使用Acegi,并且詳細(xì)介
    紹如何配置和擴(kuò)展Acegi框架以適應(yīng)實際需要。

    文章和代碼下載:

    http://www.tkk7.com/Files/youlq/Acegi.zip


    注意:許多朋友在部署上遇到一些麻煩,所以我將可以部署的完整的war文件傳上來,注意:java代碼在acegi-sample.war\WEB-INF 目錄下,例子需要Mysql,建庫腳本在acegi-sample.war\db目錄下。

    acegi-sample.part1.rar
    acegi-sample.part2.rar
    acegi-sample.part3.rar
    acegi-sample.part4.rar

    附注:

    有些朋友詢問我如何部署文中的例子,在此再次說明一下(文章中已經(jīng)有提到):

    Mysql的建表腳本在db目錄下
    為了減小體積,已經(jīng)將WEB-INF\lib下的依賴包刪除,請自行下載以下包,并拷貝至WEB-INF\lib下:
    spring-1.2.4.jar
    acegi-security-0.8.3.jar
    aopalliance-1.0.jar
    c3p0-0.9.0.jar
    commons-logging-1.0.4.jar
    ehcache-1.1.jar
    log4j-1.2.8.jar
    mysql-connector-java-3.1.10-bin.jar
    oro-2.0.8.jar

    提示:
    acegi-security-0.8.3.jar
    aopalliance-1.0.jar
    c3p0-0.9.0.jar
    commons-logging-1.0.4.jar
    ehcache-1.1.jar
    log4j-1.2.8.jar
    oro-2.0.8.jar
    可以在acegi-security-0.8.3.zip所帶的acegi-security-sample-contacts-filter.war中找到。
    spring-1.2.4.jar
    mysql-connector-java-3.1.10-bin.jar
    要分別到springframework和mysql網(wǎng)站下載。



    posted @ 2005-12-06 10:49 一餐三碗 閱讀(50071) | 評論 (72)編輯 收藏

    鏈接:AWT, Swing, SWT, and JFace: A comparison of Java GUI libraries

    原文見

    http://www.tomlauren.com/weblog/archives/000022.html


    文章橫向比較了AWT, Swing, SWT, and JFace這幾個java gui 庫,并且給出了比較示例代碼。

    最后給出了比較表格:


    GUI Library Native Speed Native Look Advanced Compontents Available External Jar(s) and java.library.path variable required Manual resource disposal necessary
    AWT Yes Yes No No No
    Swing No Not really Yes No No
    SWT & JFace Yes Yes Yes Yes Yes
    posted @ 2005-11-17 16:00 一餐三碗 閱讀(778) | 評論 (0)編輯 收藏

    Acegi 0.9.0 發(fā)布

    Acegi 0.9.0發(fā)布有好幾天了,直接從0.8.3跳到0.9.0,應(yīng)該有不小的變化。

    Release Notes


    轉(zhuǎn)一篇文章:

    How to upgrade from Acegi Security 0.8.3 to 0.9.0
    posted @ 2005-11-14 21:22 一餐三碗 閱讀(406) | 評論 (0)編輯 收藏

    Dojo WYSIWYG web editor

    Dojo 發(fā)布 WYSIWYG web editor

    消息來源:

    http://dojotoolkit.org/docs/rich_text.html

    demo

    posted @ 2005-11-09 09:08 一餐三碗 閱讀(676) | 評論 (0)編輯 收藏

    采用jxl實現(xiàn)數(shù)據(jù)庫結(jié)果集導(dǎo)出到excel文件

         摘要: 采用jxl實現(xiàn)數(shù)據(jù)庫結(jié)果集導(dǎo)出到excel文件 關(guān)鍵字: jxl, excel, servlet代碼:servlet:import?jxl.WorkbookSettings;import?jxl.Workbook;import?jxl.write.WritableWorkbook;import?jxl.write.WritableSheet;import?j...  閱讀全文
    posted @ 2005-11-06 16:04 一餐三碗 閱讀(6714) | 評論 (4)編輯 收藏
    僅列出標(biāo)題
    共2頁: 上一頁 1 2 
    主站蜘蛛池模板: 国产免费一区二区三区免费视频| 四虎影视精品永久免费网站| 亚洲国产情侣一区二区三区| 四虎在线免费播放| 精精国产www视频在线观看免费| 久久亚洲私人国产精品| 日本高清免费不卡在线| 99久久免费国产精品热| 国产精品亚洲片夜色在线| 亚洲一区二区三区乱码A| 0588影视手机免费看片| 一本久久免费视频| 亚洲一区欧洲一区| 亚洲国产综合无码一区 | 在线免费观看一级毛片| 精品97国产免费人成视频| 亚洲av无码国产综合专区 | 久久久久亚洲AV无码专区首| 一区二区三区免费视频网站| 国产亚洲精品高清在线| 成年免费大片黄在线观看岛国| 一个人看的免费观看日本视频www 一个人看的免费视频www在线高清动漫 | 一级毛片免费不卡| 国产成人精品日本亚洲专区6| 国产亚洲自拍一区| 国产男女猛烈无遮档免费视频网站| 久久精品无码专区免费青青| 免费一级全黄少妇性色生活片| 亚洲国产中文字幕在线观看| 7723日本高清完整版免费| 国产在线国偷精品免费看| 精品亚洲成a人在线观看| 亚洲一级大黄大色毛片| 亚洲av无码专区在线播放| 又粗又大又长又爽免费视频| 免费精品国产自产拍在线观看图片 | 一区二区亚洲精品精华液| 哒哒哒免费视频观看在线www| 亚洲视频免费在线看| 亚洲国产精品99久久久久久| 亚洲精品国精品久久99热|