本文整理了Java中org.apache.wicket.request.Request.getContainerRequest
方法的一些代码示例,展示了Request.getContainerRequest
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getContainerRequest
方法的具体详情如下:
包路径:org.apache.wicket.request.Request
类名称:Request
方法名:getContainerRequest
[英]Provides access to the low-level container request object that implementaion of this Request delegate to. This allows users to access features provided by the container requests but not by generalized Wicket Request objects.
[中]提供对实现此请求委托的低级容器请求对象的访问。这允许用户访问容器请求提供的功能,但不能访问广义Wicket请求对象提供的功能。
代码示例来源:origin: apache/wicket
@Override
public Object getContainerRequest()
{
return Request.this.getContainerRequest();
}
};
代码示例来源:origin: org.apache.wicket/wicket-request
@Override
public Object getContainerRequest()
{
return Request.this.getContainerRequest();
}
};
代码示例来源:origin: apache/wicket
/**
* @param request The Wicket request
* @return The http servlet request
*/
protected final HttpServletRequest getHttpServletRequest(final Request request)
{
Object containerRequest = request.getContainerRequest();
if (containerRequest == null || (containerRequest instanceof HttpServletRequest) == false)
{
throw new IllegalArgumentException("Request must be ServletWebRequest");
}
return (HttpServletRequest)containerRequest;
}
代码示例来源:origin: org.apache.wicket/wicket-core
/**
* @param request The Wicket request
* @return The http servlet request
*/
protected final HttpServletRequest getHttpServletRequest(final Request request)
{
Object containerRequest = request.getContainerRequest();
if (containerRequest == null || (containerRequest instanceof HttpServletRequest) == false)
{
throw new IllegalArgumentException("Request must be ServletWebRequest");
}
return (HttpServletRequest)containerRequest;
}
代码示例来源:origin: org.onehippo.cms7/hippo-cms-console-frontend
private String getRequestUrl() {
final Object request = getRequest().getContainerRequest();
if (request instanceof HttpServletRequest) {
return ((HttpServletRequest) request).getRequestURL().toString();
}
return null;
}
}
代码示例来源:origin: org.onehippo.cms7/hippo-cms-console-frontend
private String getServerName() {
final Object request = getRequest().getContainerRequest();
if(request instanceof HttpServletRequest) {
return ((HttpServletRequest) request).getServerName();
}
return StringUtils.EMPTY;
}
}
代码示例来源:origin: org.onehippo.cms7/hippo-cms-engine
@Override
public void onBeginRequest(RequestCycle cycle)
{
if (log.isDebugEnabled())
{
HttpServletRequest containerRequest = (HttpServletRequest)cycle.getRequest()
.getContainerRequest();
String origin = containerRequest.getHeader("Origin");
log.debug("Request header Origin: {}", origin);
}
}
代码示例来源:origin: apache/wicket
@Override
public void onBeginRequest(RequestCycle cycle)
{
if (log.isDebugEnabled())
{
HttpServletRequest containerRequest = (HttpServletRequest)cycle.getRequest()
.getContainerRequest();
log.debug("Request Source URI: {}", getSourceUri(containerRequest));
}
}
代码示例来源:origin: org.apache.wicket/wicket-core
@Override
public void onBeginRequest(RequestCycle cycle)
{
if (log.isDebugEnabled())
{
HttpServletRequest containerRequest = (HttpServletRequest)cycle.getRequest()
.getContainerRequest();
log.debug("Request Source URI: {}", getSourceUri(containerRequest));
}
}
代码示例来源:origin: org.onehippo.cms7/hippo-cms-engine
/**
* {@link #login()} method invokes this method if there's any <code>UserCredentials</code> object from the request.
* For example, Web SSO Agent can set a UserCredentials for the user as request attribute.
*/
protected UserCredentials getUserCredentialsFromRequestAttribute() {
HttpServletRequest request = ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest());
return (UserCredentials)request.getAttribute(UserCredentials.class.getName());
}
代码示例来源:origin: org.onehippo.cms7/hippo-cms-editor-frontend
private void renderButtonInOSX() {
//OMG: ugly workaround.. Input[type=file] is rendered differently on OSX in all browsers..
HttpServletRequest httpServletReq = (HttpServletRequest) RequestCycle.get().getRequest().getContainerRequest();
String ua = httpServletReq.getHeader("User-Agent");
if (ua.contains("Macintosh")) {
uploadButton.add(new AttributeAppender("class", new Model<>("upload-button-osx")));
}
}
代码示例来源:origin: micromata/projectforge
public Map<String, Object> getData(final List<TimesheetDO> timeSheets, final Integer taskId, final Request request, final Response response,
final TimesheetFilter actionFilter)
{
return getData(timeSheets, taskId, (HttpServletRequest) request.getContainerRequest(),
(HttpServletResponse) response.getContainerResponse(), actionFilter);
}
代码示例来源:origin: org.wicketstuff/wicketstuff-shiro
/**
* {@inheritDoc}
*/
@Override
protected HttpServletRequest load()
{
return (HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest();
}
}
代码示例来源:origin: org.opensingular/singular-wicket-utils
@Override
public void onBeginRequest(RequestCycle cycle) {
if (getLogger().isDebugEnabled()) {
HttpServletRequest containerRequest = (HttpServletRequest) cycle.getRequest()
.getContainerRequest();
getLogger().debug("Request Source URI: {}", getSourceUri(containerRequest));
}
}
代码示例来源:origin: apache/syncope
@Override
protected byte[] render() {
LOG.debug("Generate captcha");
String captcha = RANDOM_LETTERS.generate(6);
HttpServletRequest request = ((HttpServletRequest) RequestCycle.get().getRequest().getContainerRequest());
// store the captcha in the current session
request.getSession().setAttribute(SyncopeEnduserConstants.CAPTCHA_SESSION_KEY, captcha);
getChallengeIdModel().setObject(captcha);
return super.render();
}
代码示例来源:origin: org.apache.syncope.client/syncope-client-enduser
@Override
protected byte[] render() {
LOG.debug("Generate captcha");
String captcha = RANDOM_LETTERS.generate(6);
HttpServletRequest request = ((HttpServletRequest) RequestCycle.get().getRequest().getContainerRequest());
// store the captcha in the current session
request.getSession().setAttribute(SyncopeEnduserConstants.CAPTCHA_SESSION_KEY, captcha);
getChallengeIdModel().setObject(captcha);
return super.render();
}
代码示例来源:origin: org.opensingular/singular-server-commons
@Override
public void onBeginRequest(RequestCycle cycle) {
HttpServletRequest mockHttpServletRequest = (HttpServletRequest) cycle.getRequest().getContainerRequest();
HttpServletRequest superPoweredMockRequest = getSuperPoweredHttpRequest(mockHttpServletRequest);
ServletWebRequest superPoweredRequest = getSuperPoweredRequest((ServletWebRequest) cycle.getRequest(), superPoweredMockRequest);
cycle.setRequest(superPoweredRequest);
ContextUtil.prepareRequest(superPoweredMockRequest);
}
代码示例来源:origin: org.opensingular/singular-requirement-commons
@Override
public void onBeginRequest(RequestCycle cycle) {
HttpServletRequest mockHttpServletRequest = (HttpServletRequest) cycle.getRequest().getContainerRequest();
HttpServletRequest superPoweredMockRequest = getSuperPoweredHttpRequest(mockHttpServletRequest);
ServletWebRequest superPoweredRequest = getSuperPoweredRequest((ServletWebRequest) cycle.getRequest(), superPoweredMockRequest);
cycle.setRequest(superPoweredRequest);
ContextUtil.prepareRequest(superPoweredMockRequest);
}
代码示例来源:origin: org.opensingular/server-commons
@Override
public void onRequestHandlerResolved(RequestCycle cycle, IRequestHandler handler) {
SingularServerConfiguration singularServerConfiguration = SingularApplication.get().getApplicationContext().getBean(SingularServerConfiguration.class);
if (SingularSession.get().isAuthtenticated() && isPageRequest(handler)) {
HttpServletRequest request = (HttpServletRequest) cycle.getRequest().getContainerRequest();
IServerContext context = IServerContext.getContextFromRequest(request, singularServerConfiguration.getContexts());
if (!SingularSession.get().getServerContext().equals(context)) {
resetLogin(cycle);
}
}
}
代码示例来源:origin: org.opensingular/singular-requirement-module
@Override
public void onBeginRequest(RequestCycle cycle) {
HttpServletRequest mockHttpServletRequest = (HttpServletRequest) cycle.getRequest().getContainerRequest();
HttpServletRequest superPoweredMockRequest = getSuperPoweredHttpRequest(mockHttpServletRequest);
ServletWebRequest superPoweredRequest = getSuperPoweredRequest((ServletWebRequest) cycle.getRequest(), superPoweredMockRequest);
cycle.setRequest(superPoweredRequest);
ContextUtil.prepareRequest(superPoweredMockRequest);
}
内容来源于网络,如有侵权,请联系作者删除!