Response.java 文件源码

java
阅读 41 收藏 0 点赞 0 评论 0

项目:tomcat7 作者:
/**
 * Add the specified Cookie to those that will be included with
 * this Response.
 *
 * @param cookie Cookie to be added
 */
@Override
public void addCookie(final Cookie cookie) {

    // Ignore any call from an included servlet
    if (included || isCommitted()) {
        return;
    }

    final StringBuffer sb = generateCookieString(cookie);
    //if we reached here, no exception, cookie is valid
    // the header name is Set-Cookie for both "old" and v.1 ( RFC2109 )
    // RFC2965 is not supported by browsers and the Servlet spec
    // asks for 2109.
    addHeader("Set-Cookie", sb.toString());
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号