當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。