当前位置: 首页>>代码示例>>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;未经允许,请勿转载。