org.eclipse.jetty.server.Response.addSetCookie()方法的使用及代码示例

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

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

Response.addSetCookie介绍

[英]Format a set cookie value
[中]设置cookie值的格式

代码示例

代码示例来源:origin: theonedev/onedev

@Override
public void addCookie(Cookie cookie)
{
  String comment = cookie.getComment();
  boolean httpOnly = false;
  if (comment != null)
  {
    int i = comment.indexOf(HTTP_ONLY_COMMENT);
    if (i >= 0)
    {
      httpOnly = true;
      comment = comment.replace(HTTP_ONLY_COMMENT, "").trim();
      if (comment.length() == 0)
        comment = null;
    }
  }
  addSetCookie(cookie.getName(),
      cookie.getValue(),
      cookie.getDomain(),
      cookie.getPath(),
      cookie.getMaxAge(),
      comment,
      cookie.getSecure(),
      httpOnly || cookie.isHttpOnly(),
      cookie.getVersion());
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

@Override
public void addCookie(Cookie cookie)
{
  String comment = cookie.getComment();
  boolean httpOnly = false;
  if (comment != null)
  {
    int i = comment.indexOf(HTTP_ONLY_COMMENT);
    if (i >= 0)
    {
      httpOnly = true;
      comment = comment.replace(HTTP_ONLY_COMMENT, "").trim();
      if (comment.length() == 0)
        comment = null;
    }
  }
  addSetCookie(cookie.getName(),
      cookie.getValue(),
      cookie.getDomain(),
      cookie.getPath(),
      cookie.getMaxAge(),
      comment,
      cookie.getSecure(),
      httpOnly || cookie.isHttpOnly(),
      cookie.getVersion());
}

代码示例来源:origin: Nextdoor/bender

@Override
public void addCookie(Cookie cookie)
{
  String comment = cookie.getComment();
  boolean httpOnly = false;
  if (comment != null)
  {
    int i = comment.indexOf(HTTP_ONLY_COMMENT);
    if (i >= 0)
    {
      httpOnly = true;
      comment = comment.replace(HTTP_ONLY_COMMENT, "").trim();
      if (comment.length() == 0)
        comment = null;
    }
  }
  addSetCookie(cookie.getName(),
      cookie.getValue(),
      cookie.getDomain(),
      cookie.getPath(),
      cookie.getMaxAge(),
      comment,
      cookie.getSecure(),
      httpOnly || cookie.isHttpOnly(),
      cookie.getVersion());
}

代码示例来源:origin: Nextdoor/bender

public void addCookie(HttpCookie cookie)
{
  addSetCookie(
      cookie.getName(),
      cookie.getValue(),
      cookie.getDomain(),
      cookie.getPath(),
      cookie.getMaxAge(),
      cookie.getComment(),
      cookie.isSecure(),
      cookie.isHttpOnly(),
      cookie.getVersion());;
}

代码示例来源:origin: theonedev/onedev

public void addCookie(HttpCookie cookie)
{
  addSetCookie(
      cookie.getName(),
      cookie.getValue(),
      cookie.getDomain(),
      cookie.getPath(),
      cookie.getMaxAge(),
      cookie.getComment(),
      cookie.isSecure(),
      cookie.isHttpOnly(),
      cookie.getVersion());;
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

public void addCookie(HttpCookie cookie)
{
  addSetCookie(
      cookie.getName(),
      cookie.getValue(),
      cookie.getDomain(),
      cookie.getPath(),
      cookie.getMaxAge(),
      cookie.getComment(),
      cookie.isSecure(),
      cookie.isHttpOnly(),
      cookie.getVersion());;
}

相关文章