private void addCookieHeader() { if (_cookies.isEmpty()) return; StringBuffer sb = new StringBuffer(); for (Enumeration e = _cookies.elements(); e.hasMoreElements();) { Cookie cookie = (Cookie) e.nextElement(); sb.append( cookie.getName() ).append( '=' ).append( cookie.getValue() ); if (cookie.getPath() != null) sb.append( ";path=" ).append( cookie.getPath() ); if (cookie.getDomain() != null) sb.append( ";domain=" ).append( cookie.getDomain() ); if (e.hasMoreElements()) sb.append( ',' ); } setHeader( "Set-Cookie", sb.toString() ); }
private void addCookieHeader() { if (_cookies.isEmpty()) return; StringBuffer sb = new StringBuffer(); for (Enumeration e = _cookies.elements(); e.hasMoreElements();) { Cookie cookie = (Cookie) e.nextElement(); sb.append( cookie.getName() ).append( '=' ).append( cookie.getValue() ); if (cookie.getPath() != null) sb.append( ";path=" ).append( cookie.getPath() ); if (cookie.getDomain() != null) sb.append( ";domain=" ).append( cookie.getDomain() ); if (e.hasMoreElements()) sb.append( ',' ); } setHeader( "Set-Cookie", sb.toString() ); }
private void addCookieHeader() { if (_cookies.isEmpty()) return; StringBuffer sb = new StringBuffer(); for (Enumeration e = _cookies.elements(); e.hasMoreElements();) { Cookie cookie = (Cookie) e.nextElement(); sb.append( cookie.getName() ).append( '=' ).append( cookie.getValue() ); if (cookie.getPath() != null) sb.append( ";path=" ).append( cookie.getPath() ); if (cookie.getDomain() != null) sb.append( ";domain=" ).append( cookie.getDomain() ); if (e.hasMoreElements()) sb.append( ',' ); } setHeader( "Set-Cookie", sb.toString() ); }
/** * Sends a temporary redirect response to the client using the * specified redirect location URL. The URL must be absolute (for * example, <code><em>https://hostname/path/file.html</em></code>). * Relative URLs are not permitted here. */ public void sendRedirect( String location ) throws IOException { setStatus( HttpServletResponse.SC_MOVED_TEMPORARILY ); setHeader( "Location", location ); }
/** * Adds a field to the response header with the given name and * integer value. If the field had already been set, the new value * overwrites the previous one. The <code>containsHeader</code> * method can be used to test for the presence of a header before * setting its value. **/ public void setIntHeader( String name, int value ) { setHeader( name, asHeaderValue( value ) ); }
/** * Adds a field to the response header with the given name and * date-valued field. The date is specified in terms of * milliseconds since the epoch. If the date field had already * been set, the new value overwrites the previous one. The * <code>containsHeader</code> method can be used to test for the * presence of a header before setting its value. **/ public void setDateHeader( String name, long date ) { setHeader( name, asDateHeaderValue( date ) ); }
/** * Sends a temporary redirect response to the client using the * specified redirect location URL. The URL must be absolute (for * example, <code><em>https://hostname/path/file.html</em></code>). * Relative URLs are not permitted here. */ public void sendRedirect( String location ) throws IOException { setStatus( HttpServletResponse.SC_MOVED_TEMPORARILY ); setHeader( "Location", location ); }
/** * Adds a field to the response header with the given name and * integer value. If the field had already been set, the new value * overwrites the previous one. The <code>containsHeader</code> * method can be used to test for the presence of a header before * setting its value. **/ public void setIntHeader( String name, int value ) { setHeader( name, asHeaderValue( value ) ); }
/** * Adds a field to the response header with the given name and * integer value. If the field had already been set, the new value * overwrites the previous one. The <code>containsHeader</code> * method can be used to test for the presence of a header before * setting its value. **/ public void setIntHeader( String name, int value ) { setHeader( name, asHeaderValue( value ) ); }
/** * Adds a field to the response header with the given name and * date-valued field. The date is specified in terms of * milliseconds since the epoch. If the date field had already * been set, the new value overwrites the previous one. The * <code>containsHeader</code> method can be used to test for the * presence of a header before setting its value. **/ public void setDateHeader( String name, long date ) { setHeader( name, asDateHeaderValue( date ) ); }
/** * Sends a temporary redirect response to the client using the * specified redirect location URL. The URL must be absolute (for * example, <code><em>https://hostname/path/file.html</em></code>). * Relative URLs are not permitted here. */ public void sendRedirect( String location ) throws IOException { setStatus( HttpServletResponse.SC_MOVED_TEMPORARILY ); setHeader( "Location", location ); }
/** * Adds a field to the response header with the given name and * date-valued field. The date is specified in terms of * milliseconds since the epoch. If the date field had already * been set, the new value overwrites the previous one. The * <code>containsHeader</code> method can be used to test for the * presence of a header before setting its value. **/ public void setDateHeader( String name, long date ) { setHeader( name, asDateHeaderValue( date ) ); }
private void completeHeaders() { if (_headersComplete) return; addCookieHeader(); setHeader( "Content-Type", _contentType + "; charset=" + getCharacterEncoding() ); _headersComplete = true; }
private void completeHeaders() { if (_headersComplete) return; addCookieHeader(); setHeader( "Content-Type", _contentType + "; charset=" + getCharacterEncoding() ); _headersComplete = true; }
private void completeHeaders() { if (_headersComplete) return; addCookieHeader(); setHeader( "Content-Type", _contentType + "; charset=" + getCharacterEncoding() ); _headersComplete = true; }