title: wicket download output stream
body: <p>I want to download csv file , i take the response content and write to it , apprently wicket write after me and the content iam getting is the page html where it should be my csv </p>
  
  <p>I have seen in the example the usage of  throw new AbortException();
  I am using version 6.7 , do you know if my version wicket has somthing instead of it ? 
  or rather I am doing somthing wrong .... </p>
  
  <p>can you please help me ...  </p>
  
  <pre><code> add(new Link&lt;Void&gt;("export") {
          @Override
          public void onClick() {
  
              WebResponse response = (WebResponse) getResponse();
              response.setAttachmentHeader("export.csv");
              response.setContentType("text/csv");
  
              OutputStream out = getResponse().getOutputStream();
  
              try {
                  c.exportData(dataSource.getListForExport(), columns, out);
  
              } catch (Exception ex) {
                  System.err.println(ex);
              }
  
          }
  
      });
  
  
  
  
     public &lt;T&gt; void exportData(List&lt;T&gt; list, List&lt;IGridColumn&lt;IDataSource&lt;T&gt;, T, String&gt;&gt; columns, OutputStream outputStream)
          throws IOException {
      long startTime = System.nanoTime();
      PrintWriter out = new PrintWriter(new OutputStreamWriter(outputStream, Charset.forName(characterSet)));
      try {
          if (isExportHeadersEnabled()) {
              boolean first = true;
              for (IGridColumn&lt;IDataSource&lt;T&gt;, T, String&gt; col : columns) {
                  if (first) {
                      first = false;
                  } else {
                      out.print(delimiter);
                      System.out.println(delimiter);
                  }
                  if (col.getId().equals("checkBox")) {
                      continue;
                  }
                  out.print(quoteValue(col.getId()));
                  System.out.println(col.getId());
              }
              out.print("\r\n");
              System.out.println("\r\n");
          }
          Iterator&lt;? extends T&gt; rowIterator = list.iterator();
          while (rowIterator.hasNext()) {
              T row = rowIterator.next();
  
              boolean first = true;
              for (IGridColumn&lt;IDataSource&lt;T&gt;, T, String&gt; col : columns) {
                  if (first) {
                      first = false;
                  } else {
                      out.print(delimiter);
                      System.out.println(delimiter);
                  }
                  if (col.getId().equals("checkBox")) {
                      continue;
                  }
                  Object o = (new PropertyModel&lt;&gt;(row, col.getId())).getObject();// ((AbstractColumn&lt;T,
  
                  if (o != null) {
                      Class&lt;?&gt; c = o.getClass();
                      String s;
                      IConverter converter = Application.get().getConverterLocator().getConverter(c);
  
                      if (converter == null) {
                          s = o.toString();
                      } else {
                          s = converter.convertToString(o, Session.get().getLocale());
                      }
  
                      out.print(quoteValue(s));
                      System.out.println(quoteValue(s));
                  }
              }
              out.print("\r\n");
              System.out.println("\r\n");
          }
      } catch (Exception ex) {
          System.out.println(ex);
      } finally {
          System.out.println(out);
          out.close();
  
          // measure
          System.out.print(System.nanoTime() - startTime);
      }
  }
  </code></pre>