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

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

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

    隨筆 - 11  文章 - 11  trackbacks - 0

    留言簿(2)

    隨筆分類(13)

    隨筆檔案(11)

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    在Struts1.1-1.2中如果不想沒有登錄的用戶訪問一些action,可以擴展RequestProcessor,并重載processProprocess方法,在其中進行驗證

    public class CustomRequestProcessor
            extends RequestProcessor {
        protected boolean processPreprocess (
                HttpServletRequest request,
                HttpServletResponse response) {
            HttpSession session = request.getSession(false);
            //If user is trying to access login page
            // then don't check
            if( request.getServletPath().equals("/loginInput.do")
                || request.getServletPath().equals("/login.do") )
                return true;
            //Check if userName attribute is there is session.
            //If so, it means user has allready logged in
            if( session != null &&
            session.getAttribute("userName") != null)
                return true;
            else{
                try{
                    //If no redirect user to login Page
                    request.getRequestDispatcher 
                        ("/Login.jsp").forward(request,response);
                }catch(Exception ex){
                }
            }
            return false;
        }
    }
    

    相應(yīng)的,在struts-config.xml中加入controller元素

    <controller>
     <set-property  property="processorClass"
     value="com.sample.util.CustomRequestProcessor"/>
    </controller>
    

    但剛才看到在Struts1.3中,已經(jīng)不再使用RequestProcessor,而是用ComposableRequestProcessor 來實現(xiàn)自定義的request響應(yīng)。






    posted on 2007-04-09 18:52 hijeff 閱讀(440) 評論(0)  編輯  收藏 所屬分類: Struts

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


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 免费视频淫片aa毛片| 亚洲成色在线影院| 在线观看国产区亚洲一区成人| 亚洲人AV在线无码影院观看| 日韩免费一区二区三区在线| 亚洲w码欧洲s码免费| 国产成人yy免费视频| 亚洲国产精品一区二区九九| 日韩a毛片免费观看| 国产自偷亚洲精品页65页| 国产精品青草视频免费播放| 手机看黄av免费网址| 国产成人精品亚洲日本在线| 中国videos性高清免费| 2020久久精品国产免费| 亚洲色精品三区二区一区| 国产免费牲交视频| 亚洲精品成人图区| 国产精品免费视频观看拍拍 | 亚洲另类无码专区首页| 在线免费观看一级片| 深夜A级毛片视频免费| 久久久久国产成人精品亚洲午夜 | 久久久久高潮毛片免费全部播放| 亚洲丝袜美腿视频| 成在线人直播免费视频| 国产亚洲一区二区三区在线| 99久久免费精品视频| 亚洲成a人片在线观看无码专区| 污污视频免费观看网站| 国产精品亚洲аv无码播放| h片在线免费观看| WWW国产亚洲精品久久麻豆| 亚洲中文字幕无码一区| h视频在线免费看| 美女一级毛片免费观看| 亚洲成人中文字幕| 日本不卡高清中文字幕免费| 亚洲一卡2卡3卡4卡5卡6卡| 亚洲自偷自偷偷色无码中文| 麻豆视频免费播放|