org.apache.catalina.connector.Response.addCookie()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(175)

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

Response.addCookie介绍

[英]Add the specified Cookie to those that will be included with this Response.
[中]将指定的Cookie添加到此响应中包含的Cookie。

代码示例

代码示例来源:origin: org.jboss.web/jbossweb

public void addCookie(Cookie cookie) {
  if (isCommitted())
    return;
  response.addCookie(cookie);
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

@Override
public void addCookie(Cookie cookie) {
  if (isCommitted()) {
    return;
  }
  response.addCookie(cookie);
}

代码示例来源:origin: jboss.web/jbossweb

public void addCookie(Cookie cookie) {
  if (isCommitted())
    return;
  response.addCookie(cookie);
}

代码示例来源:origin: org.glassfish.main.web/web-core

@Override
public void addCookie(Cookie cookie) {
  // Disallow operation if the object has gone out of scope
  if (response == null) {
    throw new IllegalStateException(rb.getString(LogFacade.NULL_RESPONSE_OBJECT));
  }
  if (isCommitted())
    return;
  response.addCookie(cookie);
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

@Override
public void addCookie(Cookie cookie) {
  if (isCommitted()) {
    return;
  }
  response.addCookie(cookie);
}

代码示例来源:origin: codefollower/Tomcat-Research

@Override
public void addCookie(Cookie cookie) {
  if (isCommitted()) {
    return;
  }
  response.addCookie(cookie);
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

@Override
public void addCookie(Cookie cookie) {
  if (isCommitted()) {
    return;
  }
  response.addCookie(cookie);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
public void addCookie(Cookie cookie) {
  if (isCommitted())
    return;
  response.addCookie(cookie);
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
public void addCookie(Cookie cookie) {
  if (isCommitted())
    return;
  response.addCookie(cookie);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

@Override
public void addCookie(Cookie cookie) {
  if (isCommitted())
    return;
  response.addCookie(cookie);
}

代码示例来源:origin: tomcat/catalina

public void addCookie(Cookie cookie) {
  if (isCommitted())
    return;
  response.addCookie(cookie);
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

@Override
public void addCookie(Cookie cookie) {
  if (isCommitted()) {
    return;
  }
  response.addCookie(cookie);
}

代码示例来源:origin: com.tomitribe.tribestream/tribestream-container

private void setCookie(final RequestContext requestContext, final RewriteRule rule) {
  final Cookie cookie = new Cookie(rule.getCookieName(), rule.getCookieResult());
  ofNullable(rule.getCookieDomain()).ifPresent(cookie::setDomain);
  ofNullable(rule.getCookieLifetime()).ifPresent(cookie::setMaxAge);
  ofNullable(rule.getCookiePath()).ifPresent(cookie::setPath);
  ofNullable(rule.isCookieSecure()).ifPresent(cookie::setSecure);
  ofNullable(rule.isCookieHttpOnly()).ifPresent(cookie::setHttpOnly);
  requestContext.getResponse().addCookie(cookie);
  requestContext.getRequest().addCookie(cookie);
  @SuppressWarnings("unchecked")
  List<Cookie> cookies = requestContext.get("cookies", List.class);
  if (cookies == null) {
    cookies = new ArrayList<>();
    requestContext.set("cookies", cookies);
  }
  cookies.add(cookie);
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-tomcat7-clustering-wadi

protected void setNewSessionCookie(Request request, Response response, String augmentedSessionID) {
  Context context = request.getContext();
  if (context.getCookies()) {
    Cookie newCookie = new Cookie(ApplicationSessionCookieConfig.getSessionCookieName(request.getContext()), augmentedSessionID);
    newCookie.setMaxAge(-1);
    String contextPath = null;
    if (context != null && context.getSessionCookiePath() != null) {
      contextPath = context.getSessionCookiePath();
    }
    if ((contextPath != null) && (contextPath.length() > 0)) {
      newCookie.setPath(contextPath);
    } else {
      newCookie.setPath("/");
    }
    if (request.isSecure()) {
      newCookie.setSecure(true);
    }
    response.addCookie(newCookie);
  }
}

代码示例来源:origin: org.picketlink.distribution/picketlink-jbas7

cookie.setDomain(domainName);
response.addCookie(cookie);

代码示例来源:origin: org.picketlink/picketlink-tomcat-common

cookie.setDomain(domainName);
response.addCookie(cookie);

代码示例来源:origin: org.picketlink.distribution/picketlink-jbas5

cookie.setDomain(domainName);
response.addCookie(cookie);

代码示例来源:origin: jboss.web/jbossweb

response.addCookie(cookie);

代码示例来源:origin: org.jboss.web/jbossweb

response.addCookie(cookie);

代码示例来源:origin: tomcat/catalina

session.getIdInternal());
configureSessionCookie(cookie);
response.addCookie(cookie);

相关文章

Response类方法