Package javax.servlet.http

Examples of javax.servlet.http.HttpServletResponse.addHeader()


        if (logger.isDebugEnabled()) {
            logger.debug("WWW-Authenticate header sent to user agent: " + authenticateHeader);
        }

        httpResponse.addHeader("WWW-Authenticate", authenticateHeader);
        httpResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED, authException.getMessage());
    }

    public String getKey() {
        return key;
View Full Code Here


                            for (Cookie wc : msg.getCookies())
                                response.addCookie(getServletCookie(wc));
                        }
                        if (msg.getHeaders() != null) {
                            for (Map.Entry<String, String> h : msg.getHeaders().entries())
                                response.addHeader(h.getKey(), h.getValue());
                        }
                    }

                    if (msg.getStatus() >= 400 && msg.getStatus() < 600) {
                        response.sendError(msg.getStatus(), msg.getError() != null ? msg.getError().toString() : null);
View Full Code Here

            }
        }

        //
        if (!PropertyManager.isDevelopping()) {
            httpResponse.addHeader("Cache-Control", "max-age=2592000,s-maxage=2592000");
        } else {
            if (uri.endsWith(".jstmpl") || uri.endsWith(".js")) {
                httpResponse.setHeader("Cache-Control", "no-cache");
            }
            if (log.isDebugEnabled())
View Full Code Here

                    return;
                }
            }

            // Proxy-Authenticate Basic realm="CCProxy Authorization"
            response.addHeader( "Proxy-Authenticate", "Basic realm=\"Jetty Proxy Authorization\"" );
            response.setStatus( HttpServletResponse.SC_PROXY_AUTHENTICATION_REQUIRED );
            return;
        }

        super.service( req, res );
View Full Code Here

                for(int i=0; i<_attributes.size(); i++) {
                    Parameter p = _attributes.get(i);
                    String name = p.getName();
                    if(StringUtil.isNotEmpty(name)) {
                        String value = p.getValue();
                        response.addHeader(name, value);
                    }
                }
            }
        }
    }
View Full Code Here

  public void doFilter(ServletRequest request, ServletResponse response,
          FilterChain chain) throws IOException, ServletException {

    HttpServletResponse r = (HttpServletResponse) response;
    r.addHeader("Access-Control-Allow-Origin", "*");
    r.addHeader("Access-Control-Allow-Headers",
            "Accept,Accept-Encoding,Accept-Language,Cache-Control,Connection,Content-Length,Content-Type," +
            "Cookie,Host,Pragma,Referer,RemoteQueueID,User-Agent");
    r.addHeader("Access-Control-Allow-Credentials", "true");
    chain.doFilter(request, response);
View Full Code Here

  public void doFilter(ServletRequest request, ServletResponse response,
          FilterChain chain) throws IOException, ServletException {

    HttpServletResponse r = (HttpServletResponse) response;
    r.addHeader("Access-Control-Allow-Origin", "*");
    r.addHeader("Access-Control-Allow-Headers",
            "Accept,Accept-Encoding,Accept-Language,Cache-Control,Connection,Content-Length,Content-Type," +
            "Cookie,Host,Pragma,Referer,RemoteQueueID,User-Agent");
    r.addHeader("Access-Control-Allow-Credentials", "true");
    chain.doFilter(request, response);
  }
View Full Code Here

    HttpServletResponse r = (HttpServletResponse) response;
    r.addHeader("Access-Control-Allow-Origin", "*");
    r.addHeader("Access-Control-Allow-Headers",
            "Accept,Accept-Encoding,Accept-Language,Cache-Control,Connection,Content-Length,Content-Type," +
            "Cookie,Host,Pragma,Referer,RemoteQueueID,User-Agent");
    r.addHeader("Access-Control-Allow-Credentials", "true");
    chain.doFilter(request, response);
  }
}
View Full Code Here

                } else if (maxAge > 0) { // set max-age based on life time
                  long currentMaxAge = maxAge / 1000 - System.currentTimeMillis() / 1000;
                  if (currentMaxAge < 0) {
                    currentMaxAge = 0;
                  }
                  httpResponse.addHeader(CacheFilter.HEADER_CACHE_CONTROL, "max-age=" + currentMaxAge);
                } else {
                  httpResponse.addHeader(CacheFilter.HEADER_CACHE_CONTROL, "max-age=" + (-maxAge));
                }
               
            }
View Full Code Here

                  if (currentMaxAge < 0) {
                    currentMaxAge = 0;
                  }
                  httpResponse.addHeader(CacheFilter.HEADER_CACHE_CONTROL, "max-age=" + currentMaxAge);
                } else {
                  httpResponse.addHeader(CacheFilter.HEADER_CACHE_CONTROL, "max-age=" + (-maxAge));
                }
               
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.