How Can I put information in a outputstream from tapestry5 ?
I need a page when a user enters it open a dialog for save or open the file with the outputstream information.
I write the next code:
public class Index {
@Inject
private RequestGlobals requestGlobals;
@OnEvent("activate")
public void onActivate() {
try {
HttpServletResponse response = requestGlobals.getHTTPServletResponse();
response.setContentType("text/txt");
PrintWriter out = response.getWriter();
out.println("hellooooooo");
out.flush();
} catch (IOException ex) {
Logger.getLogger(Index.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
I hope that the result is only "helloooooooo" but is ("helloooooooo" + my html raw page)