gpt4 book ai didi

org.directwebremoting.WebContext.getHttpServletResponse()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 12:59:05 25 4
gpt4 key购买 nike

本文整理了Java中org.directwebremoting.WebContext.getHttpServletResponse()方法的一些代码示例,展示了WebContext.getHttpServletResponse()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebContext.getHttpServletResponse()方法的具体详情如下:
包路径:org.directwebremoting.WebContext
类名称:WebContext
方法名:getHttpServletResponse

WebContext.getHttpServletResponse介绍

[英]Accessor for the http response bean.

You can't use this request to directly reply to the response or to add headers or cookies.
[中]http响应bean的访问器。
您不能使用此请求直接回复响应或添加标题或cookie。

代码示例

代码示例来源:origin: org.directwebremoting/dwr

public HttpServletResponse get()
{
  WebContext webcx = WebContextFactory.get();
  return webcx.getHttpServletResponse();
}

代码示例来源:origin: riotfamily/riot

private HttpServletResponse getCapturingResponse(StringWriter sw) {
  WebContext ctx = WebContextFactory.get();
  return new CapturingResponseWrapper(ctx.getHttpServletResponse(), sw);
}

代码示例来源:origin: org.directwebremoting/dwr

public Object convertInbound(Class<?> paramType, InboundVariable data)
{
  WebContext webcx = WebContextFactory.get();
  if (HttpServletRequest.class.isAssignableFrom(paramType))
  {
    return webcx.getHttpServletRequest();
  }
  if (HttpServletResponse.class.isAssignableFrom(paramType))
  {
    return webcx.getHttpServletResponse();
  }
  if (ServletConfig.class.isAssignableFrom(paramType))
  {
    return webcx.getServletConfig();
  }
  if (ServletContext.class.isAssignableFrom(paramType))
  {
    return webcx.getServletContext();
  }
  if (HttpSession.class.isAssignableFrom(paramType))
  {
    return webcx.getSession(true);
  }
  return null;
}

代码示例来源:origin: riotfamily/riot

/**
 * Performs a logout.
 */
@RemoteMethod
public void logout() {
  WebContext ctx = WebContextFactory.get();
  LoginManager.logout(ctx.getHttpServletRequest(), 
      ctx.getHttpServletResponse());
}

代码示例来源:origin: infiniteautomation/ma-core-public

@DwrPermission(anonymous = true)
public void setLocale(String locale) {
  WebContext webContext = WebContextFactory.get();
  LocaleResolver localeResolver = new SessionLocaleResolver();
  LocaleEditor localeEditor = new LocaleEditor();
  localeEditor.setAsText(locale);
  localeResolver.setLocale(webContext.getHttpServletRequest(), webContext.getHttpServletResponse(),
      (Locale) localeEditor.getValue());
}

代码示例来源:origin: infiniteautomation/ma-core-public

result.addData("startupUri", DefaultPagesDefinition.getLoginUri(ctx.getHttpServletRequest(), ctx.getHttpServletResponse()));

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com