当前位置: 首页>>代码示例>>Java>>正文


Java HttpServletRequestWrapper.getRequest方法代码示例

本文整理汇总了Java中javax.servlet.http.HttpServletRequestWrapper.getRequest方法的典型用法代码示例。如果您正苦于以下问题:Java HttpServletRequestWrapper.getRequest方法的具体用法?Java HttpServletRequestWrapper.getRequest怎么用?Java HttpServletRequestWrapper.getRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.servlet.http.HttpServletRequestWrapper的用法示例。


在下文中一共展示了HttpServletRequestWrapper.getRequest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getHttpServletRequest

import javax.servlet.http.HttpServletRequestWrapper; //导入方法依赖的package包/类
public HttpServletRequest getHttpServletRequest(PortletRequest portletRequest) {

		HttpServletRequest httpServletRequest = PortalUtil.getHttpServletRequest(portletRequest);

		// If the request object is a wrapper that handles special namespacing considerations for portlet session
		// attributes, then get the inner-most wrapped request. This will ensure that the following call to
		// LoginUtil.login(...) will be able to work with a session that has an attribute map shared by the portal.
		if (httpServletRequest.getClass().getName().equals(NAMESPACE_SERVLET_REQUEST_FQCN)) {

			while (httpServletRequest instanceof HttpServletRequestWrapper) {
				HttpServletRequestWrapper httpServletRequestWrapper = (HttpServletRequestWrapper) httpServletRequest;
				httpServletRequest = (HttpServletRequest) httpServletRequestWrapper.getRequest();
			}
		}
		
		return httpServletRequest;
	}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:18,代码来源:CadastroBean.java

示例2: validatePossibleAuthenticationResponse

import javax.servlet.http.HttpServletRequestWrapper; //导入方法依赖的package包/类
/**
 * Handling the (possible) response
 */
@Override
protected boolean validatePossibleAuthenticationResponse(final HttpServletRequest request, final HttpServletResponse response, final String pathRequested) throws IOException { // Check
																																												// for
																																												// certificates
																																												// in
																																												// the
																																												// request
																																												// attributes
	final X509Certificate certificateArray[] = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate");
	if ((certificateArray != null) && (certificateArray.length > 0)) {
		boolean failed = Boolean.FALSE;
		for (int n = 0; n < certificateArray.length; n++) {
			try {
				certificateArray[n].checkValidity();
			} catch (final Throwable err) {
				failed = Boolean.TRUE;
			}
		}
		if (!failed) {
			final AuthenticationPrincipal principal = realm.retrieveUser(certificateArray[0].getSubjectDN().getName());
			if (principal != null) {
				principal.setAuthType(HttpServletRequest.CLIENT_CERT_AUTH);
				if (request instanceof WinstoneRequest) {
					((WinstoneRequest) request).setRemoteUser(principal);
				} else if (request instanceof HttpServletRequestWrapper) {
					final HttpServletRequestWrapper wrapper = (HttpServletRequestWrapper) request;
					if (wrapper.getRequest() instanceof WinstoneRequest) {
						((WinstoneRequest) wrapper.getRequest()).setRemoteUser(principal);
					} else {
						ClientcertAuthenticationHandler.logger.warn("Request type invalid - can't set authenticated user in request class: {}", wrapper.getRequest().getClass().getName());
					}
				} else {
					ClientcertAuthenticationHandler.logger.warn("Request type invalid - can't set authenticated user in request class: {}", request.getClass().getName());
				}
			}
		}
	}
	return Boolean.TRUE;
}
 
开发者ID:geronimo-iia,项目名称:winstone,代码行数:43,代码来源:ClientcertAuthenticationHandler.java

示例3: popWrapper

import javax.servlet.http.HttpServletRequestWrapper; //导入方法依赖的package包/类
public void popWrapper()
{
    HttpServletRequestWrapper wrapper=(HttpServletRequestWrapper)getRequest();
    HttpServletRequest request=(HttpServletRequest)wrapper.getRequest();
    setRequest(request);
}
 
开发者ID:epam,项目名称:Wilma,代码行数:7,代码来源:JSR154Filter.java


注:本文中的javax.servlet.http.HttpServletRequestWrapper.getRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。