當前位置: 首頁>>代碼示例>>Java>>正文


Java WebUtils.getRequest方法代碼示例

本文整理匯總了Java中org.apache.shiro.web.util.WebUtils.getRequest方法的典型用法代碼示例。如果您正苦於以下問題:Java WebUtils.getRequest方法的具體用法?Java WebUtils.getRequest怎麽用?Java WebUtils.getRequest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.shiro.web.util.WebUtils的用法示例。


在下文中一共展示了WebUtils.getRequest方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getHost

import org.apache.shiro.web.util.WebUtils; //導入方法依賴的package包/類
private String getHost(SessionContext context) {
    String host = context.getHost();
    if (host == null) {
        ServletRequest request = WebUtils.getRequest(context);
        if (request != null) {
            host = request.getRemoteHost();
        }
    }
    return host;

}
 
開發者ID:xuegongzi,項目名稱:rabbitframework,代碼行數:12,代碼來源:ServletContainerSessionManager.java

示例2: createExposedSession

import org.apache.shiro.web.util.WebUtils; //導入方法依賴的package包/類
protected Session createExposedSession(Session session, SessionContext context) {
    if (!WebUtils.isWeb(context)) {
        return super.createExposedSession(session, context);
    }
    ServletRequest request = WebUtils.getRequest(context);
    ServletResponse response = WebUtils.getResponse(context);
    SessionKey key = new WebSessionKey(session.getId(), request, response);
    return new DelegatingSession(this, key);
}
 
開發者ID:xuegongzi,項目名稱:rabbitframework,代碼行數:10,代碼來源:DefaultWebSessionManager.java

示例3: getSessionId

import org.apache.shiro.web.util.WebUtils; //導入方法依賴的package包/類
@Override
public Serializable getSessionId(SessionKey key) {
    Serializable id = super.getSessionId(key);
    if (id == null && WebUtils.isWeb(key)) {
        ServletRequest request = WebUtils.getRequest(key);
        ServletResponse response = WebUtils.getResponse(key);
        id = getSessionId(request, response);
    }
    return id;
}
 
開發者ID:xuegongzi,項目名稱:rabbitframework,代碼行數:11,代碼來源:DefaultWebSessionManager.java

示例4: onInvalidation

import org.apache.shiro.web.util.WebUtils; //導入方法依賴的package包/類
private void onInvalidation(SessionKey key) {
    ServletRequest request = WebUtils.getRequest(key);
    if (request != null) {
        request.removeAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID_IS_VALID);
    }
    if (WebUtils.isHttp(key)) {
        log.debug("Referenced session was invalid.  Removing session ID cookie.");
        removeSessionIdCookie(WebUtils.getHttpRequest(key), WebUtils.getHttpResponse(key));
    } else {
        log.debug("SessionKey argument is not HTTP compatible or does not have an HTTP request/response " +
                "pair. Session ID cookie will not be removed due to invalidated session.");
    }
}
 
開發者ID:xuegongzi,項目名稱:rabbitframework,代碼行數:14,代碼來源:DefaultWebSessionManager.java

示例5: getSessionKey

import org.apache.shiro.web.util.WebUtils; //導入方法依賴的package包/類
@Override
protected SessionKey getSessionKey(SubjectContext context) {
    if (WebUtils.isWeb(context)) {
        Serializable sessionId = context.getSessionId();
        ServletRequest request = WebUtils.getRequest(context);
        ServletResponse response = WebUtils.getResponse(context);
        return new WebSessionKey(sessionId, request, response);
    } else {
        return super.getSessionKey(context);

    }
}
 
開發者ID:xuegongzi,項目名稱:rabbitframework,代碼行數:13,代碼來源:DefaultWebSecurityManager.java

示例6: createExposedSession

import org.apache.shiro.web.util.WebUtils; //導入方法依賴的package包/類
protected Session createExposedSession(Session session, SessionContext context) {
	if (!WebUtils.isWeb(context)) {
		return super.createExposedSession(session, context);
	}
	ServletRequest request = WebUtils.getRequest(context);
	ServletResponse response = WebUtils.getResponse(context);
	SessionKey key = new WebSessionKey(session.getId(), request, response);
	return new DelegatingSession(this, key);
}
 
開發者ID:xuegongzi,項目名稱:rabbitframework,代碼行數:10,代碼來源:SimpleWebSessionManager.java

示例7: getSessionId

import org.apache.shiro.web.util.WebUtils; //導入方法依賴的package包/類
@Override
public Serializable getSessionId(SessionKey key) {
	Serializable id = super.getSessionId(key);
	if (id == null && WebUtils.isWeb(key)) {
		ServletRequest request = WebUtils.getRequest(key);
		ServletResponse response = WebUtils.getResponse(key);
		id = getSessionId(request, response);
	}
	return id;
}
 
開發者ID:xuegongzi,項目名稱:rabbitframework,代碼行數:11,代碼來源:SimpleWebSessionManager.java

示例8: onInvalidation

import org.apache.shiro.web.util.WebUtils; //導入方法依賴的package包/類
private void onInvalidation(SessionKey key) {
	ServletRequest request = WebUtils.getRequest(key);
	if (request != null) {
		request.removeAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID_IS_VALID);
	}
	if (WebUtils.isHttp(key)) {
		log.debug("Referenced session was invalid.  Removing session ID cookie.");
		removeSessionIdCookie(WebUtils.getHttpRequest(key), WebUtils.getHttpResponse(key));
	} else {
		log.debug("SessionKey argument is not HTTP compatible or does not have an HTTP request/response "
				+ "pair. Session ID cookie will not be removed due to invalidated session.");
	}
}
 
開發者ID:xuegongzi,項目名稱:rabbitframework,代碼行數:14,代碼來源:SimpleWebSessionManager.java

示例9: getSessionKey

import org.apache.shiro.web.util.WebUtils; //導入方法依賴的package包/類
@Override
protected SessionKey getSessionKey(SubjectContext context) {
	if (WebUtils.isWeb(context)) {
		Serializable sessionId = context.getSessionId();
		ServletRequest request = WebUtils.getRequest(context);
		ServletResponse response = WebUtils.getResponse(context);
		return new WebSessionKey(sessionId, request, response);
	} else {
		return super.getSessionKey(context);

	}
}
 
開發者ID:xuegongzi,項目名稱:rabbitframework,代碼行數:13,代碼來源:SimpleWebSecurityManager.java

示例10: getHost

import org.apache.shiro.web.util.WebUtils; //導入方法依賴的package包/類
private String getHost( SessionContext context ) {
    String host = context.getHost();
    if ( host == null ) {
        ServletRequest request = WebUtils.getRequest( context );
        if ( request != null ) {
            host = request.getRemoteHost();
        }
    }
    return host;
}
 
開發者ID:apache,項目名稱:usergrid,代碼行數:11,代碼來源:HttpRequestSessionManager.java

示例11: onStart

import org.apache.shiro.web.util.WebUtils; //導入方法依賴的package包/類
/**
 * 去掉URL後麵的jsessionid
 */
protected void onStart(Session session, SessionContext context) {  
       super.onStart(session, context);  
       ServletRequest request = WebUtils.getRequest(context);  
       request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID_SOURCE,ShiroHttpServletRequest.COOKIE_SESSION_ID_SOURCE);  
   }
 
開發者ID:penggle,項目名稱:xproject,代碼行數:9,代碼來源:CustomWebSessionManager.java


注:本文中的org.apache.shiro.web.util.WebUtils.getRequest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。