Package javax.servlet.http

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


     * @param value the header value
     */
    public void addHeader(String name, String value) {
        HttpServletResponse res = getServletResponse();
        if (res != null)
            res.addHeader(name, value);
    }

    /**
     * Proxy to HttpServletResponse.addDateHeader()
     * @param name the header name
View Full Code Here


  public ContentType encode(Packet packet, OutputStream out) throws IOException {
    if(gzip && packet.supports(MessageContext.SERVLET_REQUEST) &&
        isGzipInRequest((HttpServletRequest)packet.get(MessageContext.SERVLET_REQUEST))){
      HttpServletResponse response = (HttpServletResponse)packet.get(MessageContext.SERVLET_RESPONSE);
      if(!response.isCommitted()){
        response.addHeader("Content-Encoding", "gzip");
        out = new GZIPOutputStream(out);
      }
    }
    try {
      // MessageContext.MESSAGE_OUTBOUND_PROPERTY set by JAX_WS only if handler configured. But encode always a out bound.
View Full Code Here

                if (null != headers) {
                    for (Iterator<?> iter = headers.keySet().iterator(); iter.hasNext();) {
                        String header = (String)iter.next();
                        List<?> headerList = (List<?>)headers.get(header);
                        for (Object string : headerList) {
                            response.addHeader(header, (String)string);
                        }
                    }
                }
                origOut.resetOut(new BufferedOutputStream(response.getOutputStream(), 1024));
            }
View Full Code Here

            //   the user doesn't get "unable to open..." when using IE.)
            response.reset();
            final String fileName = fileComponent.getFileName();
            if (fileComponent.isPrompt() && fileName != null && fileName.trim().length() > 0)
            {
                response.addHeader(
                    "Content-disposition",
                    "attachment; filename=\"" + fileName + '"');
            }

            Object value = fileComponent.getValue();
View Full Code Here

        HttpServletRequest req = event.getRequest();
        HttpServletResponse res = event.getResponse();

        res.setContentType("text/html");
        res.addHeader("Cache-Control", "private");
        res.addHeader("Pragma", "no-cache");
        if (req.getMethod().equalsIgnoreCase("GET")) {
            event.suspend();
        } else if (req.getMethod().equalsIgnoreCase("POST")) {
View Full Code Here

        HttpServletRequest req = event.getRequest();
        HttpServletResponse res = event.getResponse();

        res.setContentType("text/html");
        res.addHeader("Cache-Control", "private");
        res.addHeader("Pragma", "no-cache");
        if (req.getMethod().equalsIgnoreCase("GET")) {
            event.suspend();
        } else if (req.getMethod().equalsIgnoreCase("POST")) {

            // There are better ways to do this, but it's the simplest way to
View Full Code Here

        HttpServletRequest req = event.getRequest();
        HttpServletResponse res = event.getResponse();

        res.setContentType("text/html;charset=ISO-8859-1");
        res.addHeader("Cache-Control", "private");
        res.addHeader("Pragma", "no-cache");

        if (req.getMethod().equalsIgnoreCase("GET")) {
            event.suspend();
View Full Code Here

        HttpServletRequest req = event.getRequest();
        HttpServletResponse res = event.getResponse();

        res.setContentType("text/html;charset=ISO-8859-1");
        res.addHeader("Cache-Control", "private");
        res.addHeader("Pragma", "no-cache");

        if (req.getMethod().equalsIgnoreCase("GET")) {
            event.suspend();

            Broadcaster bc = event.getBroadcaster();
View Full Code Here

                        + callback + "(" + message + ");</script>");
                res.getWriter().write("ok");
                res.getWriter().flush();
            } else if ("start".equals(action)) {
                res.setContentType("text/html;charset=ISO-8859-1");
                res.addHeader("Cache-Control", "private");
                res.addHeader("Pragma", "no-cache");
                String callback = req.getParameterValues("callback")[0];
                if (callback == null) {
                    callback = "alert";
                }
View Full Code Here

                res.getWriter().write("ok");
                res.getWriter().flush();
            } else if ("start".equals(action)) {
                res.setContentType("text/html;charset=ISO-8859-1");
                res.addHeader("Cache-Control", "private");
                res.addHeader("Pragma", "no-cache");
                String callback = req.getParameterValues("callback")[0];
                if (callback == null) {
                    callback = "alert";
                }
               
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.