亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? signonfilter.java

?? ejb克斯人隨風(fēng)俗
?? JAVA
字號(hào):
/* Copyright 2004 Sun Microsystems, Inc. All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  - Redistributions of source code must retain the above copyright   notice, this list of conditions and the following disclaimer.  - Redistribution in binary form must reproduce the above copyright   notice, this list of conditions and the following disclaimer in   the documentation and/or other materials provided with the   distribution.  Neither the name of Sun Microsystems, Inc. or the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.  This software is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.  You acknowledge that Software is not designed, licensed or intended for use in the design, construction, operation or maintenance of any nuclear facility. $Id: SignOnFilter.java,v 1.1 2004/04/09 00:42:42 yutayoshida Exp $ */package com.sun.j2ee.blueprints.signon.web;import java.io.*;import java.util.*;import java.net.URL;// J2EE importsimport javax.servlet.*;import javax.servlet.http.*;import javax.naming.*;import com.sun.j2ee.blueprints.signon.SignOnFacade;public class SignOnFilter implements Filter {    // these static strings define where to put/get things    public static final String FORM_SIGNON_URL = "j_signon_check";    public static final String FORM_USER_NAME = "j_username";    public static final String FORM_PASSWORD = "j_password";    public static final String REMEMBER_USERNAME = "j_remember_username";    public static final String USER_NAME = "j_signon_username";    public static final String SIGNED_ON_USER  = "j_signon";    public static final String ORIGINAL_URL = "j_signon_original_url";    public static final String CREATE_USER_URL = "j_create_user";    public static final String COOKIE_NAME = "bp_signon";    private HashMap protectedResources;    private FilterConfig config = null;    private String signOnErrorPage = null;    private String signOnPage = null;    private String userCreationError = null;    public void init(FilterConfig config) throws ServletException {        this.config = config;        URL protectedResourcesURL = null;        try {            protectedResourcesURL = config.getServletContext().getResource("/WEB-INF/signon-config.xml");            ConfigFileSignOnDAO dao = new ConfigFileSignOnDAO(protectedResourcesURL);            signOnErrorPage = dao.getSignOnErrorPage();            signOnPage = dao.getSignOnPage();            protectedResources = dao.getProtectedResources();        } catch (java.net.MalformedURLException ex) {                        System.err.println("SignonFilter: malformed URL exception: " + ex);            throw new RuntimeException(ex);        }    }    public void destroy() {        config = null;    }     public  void doFilter(ServletRequest request, ServletResponse  response, FilterChain chain)        throws IOException, ServletException {        HttpServletRequest hreq = (HttpServletRequest)request;        String currentURI = hreq.getRequestURL().toString();        String currentURL = hreq.getRequestURI();        // get everything after the context root        int firstSlash = currentURL.indexOf("/",1); // jump past the starting slash        String targetURL = null;        if (firstSlash != -1) targetURL = currentURL.substring(firstSlash + 1, currentURL.length());        if ((targetURL != null) && targetURL.equals(FORM_SIGNON_URL)) {            validateSignOn(request, response, chain);            // jump out of this method            return;        }        // check if the user is signed on        boolean signedOn = false;        if (hreq.getSession().getAttribute(SIGNED_ON_USER) != null) {            signedOn =((Boolean)hreq.getSession().getAttribute(SIGNED_ON_USER)).booleanValue();        } else {            hreq.getSession().setAttribute(SIGNED_ON_USER, new Boolean(false));        }        // jump to the resource if signed on        if (signedOn) {                chain.doFilter(request,response);                return;        }        // find out if the patterns match the target URL        Iterator it = protectedResources.keySet().iterator();        while (it.hasNext()) {            String protectedName = (String)it.next();            ProtectedResource resource  = (ProtectedResource)protectedResources.get(protectedName);            String urlPattern = resource.getURLPattern();            // now check agains the targetURL            if (urlPattern.equals(targetURL)) {                // put the orginal url in the session so others can access                hreq.getSession().setAttribute(ORIGINAL_URL,  targetURL);                config.getServletContext().getRequestDispatcher("/" + signOnPage).forward(request, response);                // Jump out of the filter and go to the next page                return;            }        }        // No matches if we made it to here        chain.doFilter(request,response);    }     public  void validateSignOn(ServletRequest request, ServletResponse  response, FilterChain chain)        throws IOException, ServletException {        // convert to a http servlet request for now        HttpServletRequest hreq = (HttpServletRequest)request;        HttpServletResponse hres = (HttpServletResponse)response;        // get the user name        String userName = hreq.getParameter(FORM_USER_NAME);        // get the password        String password = hreq.getParameter(FORM_PASSWORD);        // check if the user wants userName set in cookie        String rememberUserName = hreq.getParameter(REMEMBER_USERNAME);        if (rememberUserName != null) {          // set a cookie with the username in it          Cookie userNameCookie = new Cookie(COOKIE_NAME, userName);          // set cookie to last for one month          userNameCookie.setMaxAge(2678400);          hres.addCookie(userNameCookie);        } else {            // see if the cookie exists and remove accordingly            Cookie[] cookies = hreq.getCookies();            if (cookies != null) {                for (int loop=0; loop < cookies.length; loop++) {                    if (cookies[loop].getName().equals(COOKIE_NAME)) {                        cookies[loop].setMaxAge(0);                        hres.addCookie(cookies[loop]);                    }                }            }        }        //validate against the registered users        try {            SignOnFacade signOn = new SignOnFacade();            boolean authenticated = signOn.authenticate(userName, password);            if (authenticated) {                // place a true boolean in the session                if (hreq.getSession().getAttribute(USER_NAME) != null) {                    hreq.getSession().removeAttribute(USER_NAME);                }                hreq.getSession().setAttribute(USER_NAME, userName);                // remove the sign on user key before putting it back in                if (hreq.getSession().getAttribute(SIGNED_ON_USER) != null) {                    hreq.getSession().removeAttribute(SIGNED_ON_USER);                }                hreq.getSession().setAttribute(SIGNED_ON_USER, new Boolean(true));                // redirect to the original destination                String targetURL = (String)hreq.getSession().getAttribute(ORIGINAL_URL);                hres.sendRedirect(targetURL);                return;            } else {                hres.sendRedirect(signOnErrorPage);                return;            }        } catch(Exception e) {            System.out.println("SignOnFilter signOnError:::exception to:" + e);        }     } }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜电影在线观看| 国产精品天美传媒| 亚洲国产人成综合网站| 欧美日精品一区视频| 首页亚洲欧美制服丝腿| 日韩欧美久久一区| 国产高清久久久久| 亚洲欧美怡红院| 欧美性生活影院| 麻豆91小视频| 久久久精品日韩欧美| 99re成人精品视频| 亚洲福利视频一区| 精品剧情v国产在线观看在线| 国产成人精品影视| 一区二区三区中文字幕| 555www色欧美视频| 粉嫩aⅴ一区二区三区四区| 亚洲女同女同女同女同女同69| 欧美三级中文字幕| 国产美女娇喘av呻吟久久| 亚洲欧美日韩国产一区二区三区 | 777久久久精品| 国产精品99久久久久久久vr| 中文字幕色av一区二区三区| 欧美日韩卡一卡二| 国产精品一区二区三区乱码| 亚洲国产精品一区二区www在线| 欧美成人a在线| 在线观看国产91| 国产在线播放一区二区三区| 亚洲综合区在线| 久久精品一区二区三区不卡| 欧美午夜电影网| 国产成人综合视频| 日韩二区三区在线观看| 日本一二三不卡| 欧美大片拔萝卜| 91福利国产成人精品照片| 国产一区 二区 三区一级| 亚洲一区二区三区在线| 国产精品欧美一区喷水| 欧美一区二区视频网站| 色综合久久99| 高清不卡在线观看av| 奇米色777欧美一区二区| 中文字幕在线一区| 精品久久久久av影院 | 欧美日韩国产高清一区二区 | 欧美在线观看你懂的| 国产精品一级片| 日本不卡一区二区三区高清视频| 亚洲色大成网站www久久九九| 日韩精品一区二区在线观看| 欧美色综合天天久久综合精品| 成人精品高清在线| 国产成人欧美日韩在线电影| 美女精品自拍一二三四| 亚洲va欧美va天堂v国产综合| 椎名由奈av一区二区三区| 日本一区二区三区视频视频| 日韩欧美一区在线| 欧美精品丝袜中出| 在线亚洲人成电影网站色www| 粉嫩欧美一区二区三区高清影视| 毛片基地黄久久久久久天堂| 免费在线观看不卡| 日本怡春院一区二区| 日韩激情av在线| 人禽交欧美网站| 免费xxxx性欧美18vr| 日韩中文字幕av电影| 香蕉影视欧美成人| 午夜欧美大尺度福利影院在线看| 亚洲在线一区二区三区| 一区二区三区精密机械公司| 亚洲色图.com| 亚洲激情六月丁香| 亚洲福利一二三区| 日韩av不卡在线观看| 美女一区二区三区在线观看| 免费成人你懂的| 国产精品中文有码| 福利91精品一区二区三区| 成人免费毛片嘿嘿连载视频| av在线不卡观看免费观看| eeuss鲁片一区二区三区在线观看| av电影一区二区| 日本乱人伦aⅴ精品| 欧美综合亚洲图片综合区| 欧美亚洲精品一区| 欧美一区三区二区| 欧美www视频| 久久久久国产免费免费| 成人免费一区二区三区视频| 亚洲伊人伊色伊影伊综合网| 日本美女一区二区三区视频| 美女脱光内衣内裤视频久久网站| 国产一区二区按摩在线观看| 不卡一区二区三区四区| 一本大道久久a久久综合婷婷| 欧美性受xxxx| 亚洲精品在线观| 国产精品久久久久7777按摩 | 亚洲mv在线观看| 九九精品视频在线看| 国产成人在线视频网站| 91麻豆123| 日韩三级高清在线| 国产精品灌醉下药二区| 午夜私人影院久久久久| 国产精品一色哟哟哟| 色综合久久综合网| 日韩免费高清av| 亚洲欧美综合另类在线卡通| 午夜欧美在线一二页| 国产成人综合自拍| 欧美三片在线视频观看 | 成人av网在线| 欧美一区二区三区男人的天堂| 26uuu亚洲综合色| 亚洲欧美视频在线观看视频| 裸体一区二区三区| 在线观看一区日韩| 国产亚洲午夜高清国产拍精品| 亚洲综合在线视频| 国产乱子伦视频一区二区三区| 欧美性猛片aaaaaaa做受| 久久精品亚洲一区二区三区浴池| 亚洲成人av免费| a在线播放不卡| 久久亚洲欧美国产精品乐播 | 91亚洲男人天堂| 精品粉嫩aⅴ一区二区三区四区| 亚洲精品国产高清久久伦理二区| 国产精品一区二区在线观看不卡| 精品视频在线免费| 亚洲欧美日韩在线不卡| 国产99精品在线观看| 日韩视频在线观看一区二区| 有坂深雪av一区二区精品| 成人国产亚洲欧美成人综合网| 欧美成人aa大片| 青青草伊人久久| 欧美另类高清zo欧美| 亚洲乱码国产乱码精品精小说 | 播五月开心婷婷综合| 久久这里只有精品视频网| 亚洲成人第一页| 成人一区在线看| 2014亚洲片线观看视频免费| 麻豆极品一区二区三区| 6080yy午夜一二三区久久| 亚洲综合在线第一页| 色噜噜狠狠色综合中国| 国产精品―色哟哟| 丁香天五香天堂综合| 久久精品免视看| 国产一区二区在线电影| 精品日韩99亚洲| 另类小说综合欧美亚洲| 日韩欧美色综合| 极品少妇xxxx精品少妇偷拍| 日韩一区二区视频在线观看| 日韩精品一卡二卡三卡四卡无卡| 欧美日韩中文另类| 日韩中文字幕亚洲一区二区va在线| 欧美三级午夜理伦三级中视频| 亚洲黄色免费网站| 欧美日韩国产小视频在线观看| 婷婷开心激情综合| 欧美福利视频导航| 日韩av二区在线播放| 精品三级在线看| 国产米奇在线777精品观看| 久久久精品免费免费| 国产乱子伦视频一区二区三区| 国产三级一区二区| 成人黄页在线观看| 亚洲靠逼com| 欧美在线短视频| 免费在线成人网| 久久久99精品久久| 99国产精品久久久久久久久久| 亚洲欧洲韩国日本视频| 欧美日韩亚洲丝袜制服| 麻豆91小视频| 中文字幕一区二区三区在线不卡| 97成人超碰视| 日韩av不卡在线观看| 久久精品男人天堂av| 色婷婷精品大在线视频| 五月激情综合网| xnxx国产精品| 91蝌蚪porny九色| 男女性色大片免费观看一区二区| 久久亚洲精精品中文字幕早川悠里| 不卡一区在线观看| 日欧美一区二区| 国产精品天天摸av网|