On Tue, Nov 23, 2004 at 09:43:19AM -0600, Matt Bathje wrote:
> My only problem with doing it this way is it changes the mime-type of
> the file sometimes, which makes it harder for users to download.
> Depending on the userbase you may or may not have this problem.
The problem with usin
If you are going to do this, you might as well generalize it to:
public class FileToString {
public synchronized static String convert(File input) throws
FileNotFoundException {
String output = "";
String line = "";
StringBuffer content = new StringBuffer();
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
Hi,
Still can't get anything sensible to work. I've gone with the approach of
setting a variable in scope for the 'body' tile jsp to output, as I have to
use Tiles so that the user can still see the menu etc after the operation.
My code is:
File f = new File("C:/test/logs/test.txt");
StringBu
Perhaps a bit of "theory" is what you need. When you return a
resource such as a file from an Action with a null as the value of the
ActionFoward, you do so because the action is called FROM the response
or the page which has already been committed and presented to the
client. The call to the act
As you no doubt see, Paul's solution is for viewing in the browser and
Matt's is for downloading to the client. You can do both if you like.
Just make the file in the browser per Paul the button for downloading
the file to the client per Matt. You can have the button do a popup
which then shows
to a request
scoped attribute. The contents of this attribute can then be displayed in
the relevant tile.
Paul
-Original Message-
From: Matt Bathje [mailto:[EMAIL PROTECTED]
Sent: 23 November 2004 14:40
To: Struts Users Mailing List
Subject: Re: Tiles and file download
andy wix wrote:
Hi,
I ha
To: Struts Users Mailing List
> Subject: Re: Tiles and file download
>
>
> andy wix wrote:
> > Hi,
> >
> > I have a requirement to allow the user to view log files in
> the main
> > body tile when they click a certain menu item in the 'menu tile'.
andy wix wrote:
Hi,
I have a requirement to allow the user to view log files in the main
body tile when they click a certain menu item in the 'menu tile'.
I see on the archives that the normal way to do this is to stream the
file to the response and then return null from the action. What's the
Hi,
I have a requirement to allow the user to view log files in the main body
tile when they click a certain menu item in the 'menu tile'.
I see on the archives that the normal way to do this is to stream the file
to the response and then return null from the action. What's the approach
taken
10 matches
Mail list logo