Hi!

My T5 demo app is now pretty much up and running, it didn't take me too much
time to configure some rather advanced features as well. Really positive
experience so far! In particular I really like how simple it is to create
new components/pages. This has been the biggest drag about T4, that it was
so much hassle creating a new component and getting it to work that I almost
always ended up writing "monolithic" pages with few custom components.

I haven't gotten to the point where I write my own components on a larger
scale yet, so I'm still very curious and enthusiastic about T5!

Another great feature was file streaming, which was SOOOOO much harder and
less intuitive in T4. Now I just need to return an instance of this class:


private final class XmlStreamResponse implements StreamResponse {

    private String xml;

    public XmlStreamResponse(String xml) {
      this.xml = xml;
    }
    public String getContentType() {
      return "text/xml";
    }

    public InputStream getStream() throws IOException {
      ByteArrayInputStream bis = new ByteArrayInputStream(xml.getBytes());
      return bis;
    }

    public void prepareResponse(Response response) {
      response.setHeader("Content-Disposition", "attachment;
filename=\"test.xml\";");
      response.setHeader("Pragma", "public");
      response.setHeader("Cache-Control", "max-age=86400");
    }
  }

Reply via email to