struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "andy wix" <stix...@hotmail.com>
Subject Re: Tiles and file download
Date Thu, 25 Nov 2004 08:57:03 GMT
Hi,

I have resolved this now.

The action code is:

File f = new File("test.log");

BufferedReader in = new BufferedReader(new FileReader(f));
String str;
while ((str = in.readLine()) != null) {
   buf.append("\n" + str);
}
in.close();
request.setAttribute("FILE", buf.toString());

and the jsp code (not pretty)is:

<%
  String text = (String)request.getAttribute("FILE");
  StringTokenizer tok = new StringTokenizer(text,"\n");

  int count = tok.countTokens();
  while (tok.hasMoreTokens()){
    out.print(tok.nextToken());%>
    <BR>
<%}


Andy

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message