Package org.apache.wicket.protocol.http

Examples of org.apache.wicket.protocol.http.WebResponse


      }

      @Override
      protected WebResponse newWebResponse(final HttpServletResponse servletResponse)
      {
        return new WebResponse(servletResponse);
      }

      @Override
      protected void outputDevelopmentModeWarning()
      {
View Full Code Here


     * @see org.apache.wicket.protocol.http.WebApplication#newWebResponse(javax.servlet.http.HttpServletResponse)
     */
    @Override
    protected WebResponse newWebResponse(final HttpServletResponse servletResponse)
    {
      return new WebResponse(servletResponse);
    }
View Full Code Here

      }

      @Override
      protected WebResponse newWebResponse(HttpServletResponse servletResponse)
      {
        return new WebResponse(servletResponse);
      }

      @Override
      protected void outputDevelopmentModeWarning()
      {
View Full Code Here

      }
    }

    String url = getUrl(protocol.toString().toLowerCase(), port, request);

    WebResponse response = (WebResponse)requestCycle.getResponse();

    // an attempt to rewrite a secure jsessionid into nonsecure, doesnt seem to work
    // Session session = Session.get();
    // if (!session.isTemporary())
    // {
    // response.addCookie(new Cookie("JSESSIONID", session.getId()));
    // }

    response.redirect(url);
  }
View Full Code Here

   *
   * @see org.apache.wicket.IRequestTarget#respond(org.apache.wicket.RequestCycle)
   */
  public void respond(RequestCycle requestCycle)
  {
    WebResponse webResponse = ((WebRequestCycle)requestCycle).getWebResponse();
    HttpServletResponse httpServletResponse = webResponse.getHttpServletResponse();
    try
    {
      if (message != null)
      {
        httpServletResponse.sendError(errorCode, message);
View Full Code Here

    @Override
    protected byte[] getImageData()
    {
      // Handle caching
      setLastModifiedTime(Time.now());
      final WebResponse response = (WebResponse)RequestCycle.get().getResponse();
      response.setHeader("Cache-Control", "no-cache, must-revalidate, max-age=0, no-store");

      // If we don't have data
      if (data == null || data.get() == null)
      {
        // Create the image and turn it into data
View Full Code Here

       
        add(new Link("exportToXml") {           
            public void onClick() {
                getRequestCycle().setRequestTarget(new IRequestTarget() {
                    public void respond(RequestCycle requestCycle) {
                        WebResponse r = (WebResponse) requestCycle.getResponse();
                        r.setAttachmentHeader("jtrac-export.xml");    
                        ItemUtils.writeAsXml(itemSearch, getJtrac(), new OutputStreamWriter(r.getOutputStream()));                  
                    }
                    public void detach(RequestCycle requestCycle) {                       
                    }                   
                });
            }
        });
               
        //========================== EXCEL EXPORT ==============================
       
        add(new Link("exportToExcel") {
            public void onClick() {
                // temporarily switch off paging of results
                itemSearch.setPageSize(-1);
                final ExcelUtils eu = new ExcelUtils(getJtrac().findItems(itemSearch), itemSearch);
                // restore page size
                itemSearch.setPageSize(pageSize);
                getRequestCycle().setRequestTarget(new IRequestTarget() {
                    public void respond(RequestCycle requestCycle) {
                        WebResponse r = (WebResponse) requestCycle.getResponse();
                        r.setAttachmentHeader("jtrac-export.xls");
                        try {
                            Map<Name, String> labels = BasePage.getLocalizedLabels(ItemListPanel.this);
                            eu.exportToExcel(labels).write(r.getOutputStream());
                        } catch (IOException e) {
                            throw new RuntimeException(e);
                        }
                    }
                    public void detach(RequestCycle requestCycle) {
View Full Code Here

                   
                    public void detach(RequestCycle requestCycle) {
                    }
                   
                    public void respond(RequestCycle requestCycle) {
                        WebResponse r = (WebResponse) requestCycle.getResponse();
                        r.setAttachmentHeader(fileName);
                        try {
                            File file = AttachmentUtils.getFile(attachment, getJtrac().getJtracHome());
                            InputStream is = new FileInputStream(file);
                            try {
                                Streams.copy(is, r.getOutputStream());
                            } catch (IOException e) {
                                throw new RuntimeException(e);
                            } finally {
                                try {
                                    is.close();
View Full Code Here

      // issue 62: fix session fixation vulnerability
      session.replaceSession();
      session.setUser(user);

      // Set Cookie
      WebResponse response = (WebResponse) getRequestCycle().getResponse();
      app().authentication().setCookie(response.getHttpServletResponse(), user);

      session.continueRequest();
    }
  }
View Full Code Here

      // server config change
      when = app().getBootDate();
    }

    int expires = app().settings().getInteger(Keys.web.pageCacheExpires, 0);
    WebResponse response = (WebResponse) getResponse();
    response.setLastModifiedTime(Time.valueOf(when));
    response.setDateHeader("Expires", System.currentTimeMillis() + Duration.minutes(expires).getMilliseconds());
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.protocol.http.WebResponse

Copyright © 2018 www.massapicom. 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.