gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-22 13:01:05 26 4
gpt4 key购买 nike

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

WebContext.getHttpServletRequest介绍

[英]Accessor for the http request information.
[中]http请求信息的访问器。

代码示例

代码示例来源:origin: stackoverflow.com

public class DWRClass {
 public doSomething(){
WebContext ctx = WebContextFactory.get();
HttpServletRequest req = ctx.getHttpServletRequest();
HttpSession sess = req.getSession(); //no parameter is the same as passing true

//Lets set another attribute for a forward or JSP to use
ArrayList<Boolean> flags = new ArrayList<Boolean>();
req.setAttribute("listOfNames", flags);
}
}

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

public HttpServletRequest get()
{
  WebContext webcx = WebContextFactory.get();
  return webcx.getHttpServletRequest();
}

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

@Override
public HttpServletRequest get()
{
  return WebContextFactory.get().getHttpServletRequest();
}

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

@SuppressWarnings({"unchecked"})
public Map<String, String[]> get()
{
  WebContext webcx = WebContextFactory.get();
  return webcx.getHttpServletRequest().getParameterMap();
}

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

public String addFileTransfer(FileTransfer generator) throws IOException
{
  String id = idGenerator.generate();
  putFileTransfer(id, generator);
  HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
  return "'" + request.getContextPath() + request.getServletPath() + downloadHandlerUrl + id + "'";
}

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

public String getPathToDwrServlet(String contextServletPath)
{
  String actualPath = contextServletPath;
  if (useAbsolutePath)
  {
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
    actualPath = LocalUtil.getFullUrlToDwrServlet(request);
  }
  return actualPath;
}

代码示例来源:origin: vivo-project/Vitro

public Object test(){
  WebContext ctx = WebContextFactory.get();
  HttpServletRequest req = ctx.getHttpServletRequest();
  VitroRequest vreq = new VitroRequest(req);
  WebappDaoFactory wdf = vreq.getWebappDaoFactory();
  
  Collection c = 
    wdf.getPropertyInstanceDao().getExistingProperties("http://example.org/property", null);
  return c.iterator().next();
}

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

private void assertIsPublishGranted(ContentContainer container) {
  AccessController.assertIsGranted("publish", container.getOwner(), 
      WebContextFactory.get().getHttpServletRequest());
}

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

public Object doFilter(Object obj, Method method, Object[] params, AjaxFilterChain chain) throws Exception {
    WebContext webContext = WebContextFactory.get();

    WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(webContext
        .getServletContext());
    MessageSource messageSource = (MessageSource) wac.getBean(messageSourceKey);

    JstlUtils.exposeLocalizationContext(webContext.getHttpServletRequest(), messageSource);

    return chain.doFilter(obj, method, params);
  }
}

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

public Object doFilter(Object obj, Method method, Object[] params, AjaxFilterChain chain) throws Exception {
    WebContext webContext = WebContextFactory.get();

    if (resourceBundleDirectory != null && resourceBundleLoader == null)
      resourceBundleLoader = new ResourceBundleLoader(webContext.getServletContext().getRealPath(
          resourceBundleDirectory));

    I18NUtils.prepareRequest(webContext.getHttpServletRequest(), localeResolverName, bundleBaseName,
        resourceBundleLoader);
    return chain.doFilter(obj, method, params);
  }
}

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

@Override
  public OutboundVariable convertOutbound(Object data, OutboundContext outctx) throws MarshallException {
    WebContext webctx = WebContextFactory.get();
    LocalizableMessage lm = (LocalizableMessage)data;
    String s = lm.getLocalizedMessage(I18NUtils.getBundle(webctx.getHttpServletRequest()));
    return super.convertOutbound(s, outctx);
  }
}

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

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

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

private void initScriptSession() {
  WebContext webContext = WebContextFactory.get();
  HttpServletRequest request = webContext.getHttpServletRequest();
  ScriptSession currentSession = webContext.getScriptSession();
  String host = request.getServerName();
  RiotUser user = AccessController.getCurrentUser();
  currentSession.setAttribute("host", host);
  currentSession.setAttribute("userId", user.getUserId());
}

代码示例来源:origin: vivo-project/Vitro

public PropertyInstance getProperty(String subjectURI, String predicateURI, String objectURI) {
  WebContext ctx = WebContextFactory.get();
  HttpServletRequest req = ctx.getHttpServletRequest();
  VitroRequest vreq = new VitroRequest(req);
  WebappDaoFactory wdf = vreq.getUnfilteredWebappDaoFactory();
  
  return wdf.getPropertyInstanceDao().getProperty(subjectURI, predicateURI, objectURI);
}

代码示例来源:origin: vivo-project/Vitro

public int deleteProp(String subjectUri, String predicateUri, String objectUri){
  WebContext ctx = WebContextFactory.get();
  HttpServletRequest req = ctx.getHttpServletRequest();
  VitroRequest vreq = new VitroRequest(req);
  vreq.getUnfilteredWebappDaoFactory().getPropertyInstanceDao().deleteObjectPropertyStatement(subjectUri, predicateUri, objectUri);
  return 0;
}

代码示例来源:origin: vivo-project/Vitro

public Collection getAllPossiblePropInstForIndividual(String individualURI) {
  WebContext ctx = WebContextFactory.get();
  HttpServletRequest req = ctx.getHttpServletRequest();
  VitroRequest vreq = new VitroRequest(req);
  WebappDaoFactory wdf = vreq.getUnfilteredWebappDaoFactory();
  Collection c = 
    wdf.getPropertyInstanceDao().getAllPossiblePropInstForIndividual(individualURI);
  return c;
}

代码示例来源:origin: vivo-project/Vitro

/**
 ********************************************************
 * Gets an Entity object for a given entities.id.
 */
public Individual entityByURI(String entityURI){
  WebContext ctx = WebContextFactory.get();
  HttpServletRequest req = ctx.getHttpServletRequest();
  VitroRequest vreq = new VitroRequest(req);
  
  Individual ind = vreq.getWebappDaoFactory().getIndividualDao().getIndividualByURI(entityURI);
  return ind;
}

代码示例来源:origin: vivo-project/Vitro

public int insertProp( PropertyInstance prop) {
  WebContext ctx = WebContextFactory.get();
  HttpServletRequest req = ctx.getHttpServletRequest();
  VitroRequest vreq = new VitroRequest(req);
  return vreq.getUnfilteredWebappDaoFactory().getPropertyInstanceDao().insertProp(prop);                
}

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

/**
   * Is the data: URL allowed by the current browser.
   * @return true if data: is allowed
   */
  protected boolean isDataUrlAvailable()
  {
    HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();

    return BrowserDetect.atLeast(request, UserAgent.IE, 8) ||
        BrowserDetect.atLeast(request, UserAgent.Gecko, 20041107) ||
        BrowserDetect.atLeast(request, UserAgent.AppleWebKit, 2) ||
        BrowserDetect.atLeast(request, UserAgent.Opera, 8);
  }
}

代码示例来源: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());
}

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