Re: Response and file downloads
Luc, At 11:42 AM 11/1/2004, you wrote: I am having a wee problem with using the response. I have a form on a page, with a submit button to download a file. That file is being pulled from a database and pushed to the response. The problem I am having, I just used that response to submit the page, so I am getting and IllegalStateException, even though it is still pushing the file to the browswer I also want to be able to send a redirect after the file is downloaded (so I can refresh the page so the form submit page is regenerated, since we are using a string to determine unique submits are only coming from the pages we generated, and not the browser address bar) Can we get a new response from the session variable (the one available to jsp writing) to send the file, then get another new response to perform a redirect Basically I want to be able to do something like the form submits, and passes to the applications perform methods through the jsp catching the submit response = new Response response.sendFile response = new Response response.sendRedirect (yes I know those are not actual methods and classes, just trying to explain what I want) Your understanding of how, exactly, the http protocol works is incorrect. Because it is a (single) request, (single) response protocol, what you're asking for cannot be done. It seems like what you want is for a user to fill out a form, click submit, then be presented with a new, fresh, form again ... with the file download on the side. If you have determined that you absolutely want this behavior (it's atypical, so doing it won't be particularly robust), consider programmatically opening another browser window on form submit from which the download will happen ... and reload your form in your main browser window. This will, of course, subject you to any headaches associated with javascipt window opening. justin __ Justin Ruthenbeck Lead Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential. See: http://www.nextengine.com/confidentiality.php __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Response and file downloads
I know there is only a single response, thats why I want to create a new one :) I don't even want to get into opening other windows nor do I want to rely on javascript for required operation. I am not sure what you are refering to as atypical or robustness... How do other sites generate files on the fly (take it out of a database, or a report just run), on form submit, and send them down the line and not run into this problem? I see many people posting many places on the net that they are using the response to send a file, a lot of them are getting this IllegalState, but I never really found a followup solution that really fit my needs. Why would the possibility exist to push a file through the response if it leaves you with the ability to go nowhere after? (not really questions possed to you Justin, just hoping to keep it alive) -Original Message- From: Justin Ruthenbeck [mailto:[EMAIL PROTECTED] Sent: Monday, November 01, 2004 2:56 PM To: Tomcat Users List Subject: Re: Response and file downloads Luc, At 11:42 AM 11/1/2004, you wrote: I am having a wee problem with using the response. I have a form on a page, with a submit button to download a file. That file is being pulled from a database and pushed to the response. The problem I am having, I just used that response to submit the page, so I am getting and IllegalStateException, even though it is still pushing the file to the browswer I also want to be able to send a redirect after the file is downloaded (so I can refresh the page so the form submit page is regenerated, since we are using a string to determine unique submits are only coming from the pages we generated, and not the browser address bar) Can we get a new response from the session variable (the one available to jsp writing) to send the file, then get another new response to perform a redirect Basically I want to be able to do something like the form submits, and passes to the applications perform methods through the jsp catching the submit response = new Response response.sendFile response = new Response response.sendRedirect (yes I know those are not actual methods and classes, just trying to explain what I want) Your understanding of how, exactly, the http protocol works is incorrect. Because it is a (single) request, (single) response protocol, what you're asking for cannot be done. It seems like what you want is for a user to fill out a form, click submit, then be presented with a new, fresh, form again ... with the file download on the side. If you have determined that you absolutely want this behavior (it's atypical, so doing it won't be particularly robust), consider programmatically opening another browser window on form submit from which the download will happen ... and reload your form in your main browser window. This will, of course, subject you to any headaches associated with javascipt window opening. justin __ Justin Ruthenbeck Lead Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential. See: http://www.nextengine.com/confidentiality.php __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Response and file downloads
Justin is of course completely correct. When you submit a form to the server, you are getting a response back. That response could be in a number of forms, but there's no such thing as creating a second response on the server and sending back both. If you want to avoid client-side scripting (which is how soemthing like this would typically be done) what you can do is return your form page simply with a link to the file to download. This link would in fact be a call to your server-side process that will push the file through THAT response. Be sure to set the content-disposition headers on the response and you'll get a Save As dialog on the client WITHOUT overwriting what's in their browser. As an alternative to the link, call a Javascript function on the pages' onLoad() event that does the same thing as clicking the link would. Or, if you really don't want to use the scripting, do it with a meta redirect (or refresh, I forget off-hand) to do the same thing. The pertinent point is that the content-disposition header will result in the Save-As dialog rather than overwriting what's on the browser already. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Mon, November 1, 2004 3:17 pm, Luc Foisy said: I know there is only a single response, thats why I want to create a new one :) I don't even want to get into opening other windows nor do I want to rely on javascript for required operation. I am not sure what you are refering to as atypical or robustness... How do other sites generate files on the fly (take it out of a database, or a report just run), on form submit, and send them down the line and not run into this problem? I see many people posting many places on the net that they are using the response to send a file, a lot of them are getting this IllegalState, but I never really found a followup solution that really fit my needs. Why would the possibility exist to push a file through the response if it leaves you with the ability to go nowhere after? (not really questions possed to you Justin, just hoping to keep it alive) -Original Message- From: Justin Ruthenbeck [mailto:[EMAIL PROTECTED] Sent: Monday, November 01, 2004 2:56 PM To: Tomcat Users List Subject: Re: Response and file downloads Luc, At 11:42 AM 11/1/2004, you wrote: I am having a wee problem with using the response. I have a form on a page, with a submit button to download a file. That file is being pulled from a database and pushed to the response. The problem I am having, I just used that response to submit the page, so I am getting and IllegalStateException, even though it is still pushing the file to the browswer I also want to be able to send a redirect after the file is downloaded (so I can refresh the page so the form submit page is regenerated, since we are using a string to determine unique submits are only coming from the pages we generated, and not the browser address bar) Can we get a new response from the session variable (the one available to jsp writing) to send the file, then get another new response to perform a redirect Basically I want to be able to do something like the form submits, and passes to the applications perform methods through the jsp catching the submit response = new Response response.sendFile response = new Response response.sendRedirect (yes I know those are not actual methods and classes, just trying to explain what I want) Your understanding of how, exactly, the http protocol works is incorrect. Because it is a (single) request, (single) response protocol, what you're asking for cannot be done. It seems like what you want is for a user to fill out a form, click submit, then be presented with a new, fresh, form again ... with the file download on the side. If you have determined that you absolutely want this behavior (it's atypical, so doing it won't be particularly robust), consider programmatically opening another browser window on form submit from which the download will happen ... and reload your form in your main browser window. This will, of course, subject you to any headaches associated with javascipt window opening. justin __ Justin Ruthenbeck Lead Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential. See: http://www.nextengine.com/confidentiality.php __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
RE: Response and file downloads
As the other poster correctly stated HTTP is a single request/response protocol -- emphasis on protocol. Once you send the headers and response to a browser from a server, you can't send another one. This is not a Tomcat issue. On Mon, 2004-11-01 at 15:17, Luc Foisy wrote: I know there is only a single response, thats why I want to create a new one :) I don't even want to get into opening other windows nor do I want to rely on javascript for required operation. I am not sure what you are refering to as atypical or robustness... How do other sites generate files on the fly (take it out of a database, or a report just run), on form submit, and send them down the line and not run into this problem? I see many people posting many places on the net that they are using the response to send a file, a lot of them are getting this IllegalState, but I never really found a followup solution that really fit my needs. Why would the possibility exist to push a file through the response if it leaves you with the ability to go nowhere after? (not really questions possed to you Justin, just hoping to keep it alive) -Original Message- From: Justin Ruthenbeck [mailto:[EMAIL PROTECTED] Sent: Monday, November 01, 2004 2:56 PM To: Tomcat Users List Subject: Re: Response and file downloads Luc, At 11:42 AM 11/1/2004, you wrote: I am having a wee problem with using the response. I have a form on a page, with a submit button to download a file. That file is being pulled from a database and pushed to the response. The problem I am having, I just used that response to submit the page, so I am getting and IllegalStateException, even though it is still pushing the file to the browswer I also want to be able to send a redirect after the file is downloaded (so I can refresh the page so the form submit page is regenerated, since we are using a string to determine unique submits are only coming from the pages we generated, and not the browser address bar) Can we get a new response from the session variable (the one available to jsp writing) to send the file, then get another new response to perform a redirect Basically I want to be able to do something like the form submits, and passes to the applications perform methods through the jsp catching the submit response = new Response response.sendFile response = new Response response.sendRedirect (yes I know those are not actual methods and classes, just trying to explain what I want) Your understanding of how, exactly, the http protocol works is incorrect. Because it is a (single) request, (single) response protocol, what you're asking for cannot be done. It seems like what you want is for a user to fill out a form, click submit, then be presented with a new, fresh, form again ... with the file download on the side. If you have determined that you absolutely want this behavior (it's atypical, so doing it won't be particularly robust), consider programmatically opening another browser window on form submit from which the download will happen ... and reload your form in your main browser window. This will, of course, subject you to any headaches associated with javascipt window opening. justin __ Justin Ruthenbeck Lead Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential. See: http://www.nextengine.com/confidentiality.php __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Response and file downloads
I know there is only a single response, thats why I want to create a new one :) Then you need to have the client create another request. How do other sites generate files on the fly (take it out of a database, or a report just run), on form submit, and send them down the line and not run into this problem? Which other sites? Can you point to one that we'd all be able to see? Often with a sample site, it's easier to tell you how they did it. I've seen some sites that simply return a thank you or other updated page. It often contains a link to the download, with a message that says a download should trigger automatically within a few seconds. In this scenario, I believe they are returning a page with a link that would cause the file to be downloaded (so the user could click it if the download didn't start) along with an HTML HEAD refresh tag like: meta http-equiv=Refresh content=1;URL=/path/to/download/file Such a refresh tag will cause the browser to wait a second (in this case 1 second because 1 is before the semicolon) and then issue a GET on the URL provided. Since the URL is for a file download, it appears that you've both triggered a download AND returned a page, but in fact, you just returned a page, and that page triggered the auto-GET that triggers the download. David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Response and file downloads
At 12:17 PM 11/1/2004, you wrote: I am not sure what you are refering to as atypical or robustness... I meant to say that you could approximate the behavior you were asking for (dual response), but doing so would be hackish. How do other sites generate files on the fly (take it out of a database, or a report just run), on form submit, and send them down the line and not run into this problem? Like fzlists said, you'll see most sites load a page in response to a download request which either provides a link which the user can click on to download the binary content (right click, save as in IE), or that scripts the browser to automatically begin downloading. This is how CNet, Yahoo, and others do this. I see many people posting many places on the net that they are using the response to send a file, a lot of them are getting this IllegalState, but I never really found a followup solution that really fit my needs. Why would the possibility exist to push a file through the response if it leaves you with the ability to go nowhere after? If your browser submits a request and the response is a mp3 (through either URL inspection or Content-Disposition header), the browser will prompt the user to Save/Open/Run/whatever the file (and won't try to display it). Once the file has been saved, it will leave you at the original page from which the file was requested. Point being that after you push binary content through the response, it leaves you with whatever the previous page's options were ... there's really no contradiction in doing so. justin -Original Message- From: Justin Ruthenbeck [mailto:[EMAIL PROTECTED] Sent: Monday, November 01, 2004 2:56 PM To: Tomcat Users List Subject: Re: Response and file downloads Luc, At 11:42 AM 11/1/2004, you wrote: I am having a wee problem with using the response. I have a form on a page, with a submit button to download a file. That file is being pulled from a database and pushed to the response. The problem I am having, I just used that response to submit the page, so I am getting and IllegalStateException, even though it is still pushing the file to the browswer I also want to be able to send a redirect after the file is downloaded (so I can refresh the page so the form submit page is regenerated, since we are using a string to determine unique submits are only coming from the pages we generated, and not the browser address bar) Can we get a new response from the session variable (the one available to jsp writing) to send the file, then get another new response to perform a redirect Basically I want to be able to do something like the form submits, and passes to the applications perform methods through the jsp catching the submit response = new Response response.sendFile response = new Response response.sendRedirect (yes I know those are not actual methods and classes, just trying to explain what I want) Your understanding of how, exactly, the http protocol works is incorrect. Because it is a (single) request, (single) response protocol, what you're asking for cannot be done. It seems like what you want is for a user to fill out a form, click submit, then be presented with a new, fresh, form again ... with the file download on the side. If you have determined that you absolutely want this behavior (it's atypical, so doing it won't be particularly robust), consider programmatically opening another browser window on form submit from which the download will happen ... and reload your form in your main browser window. This will, of course, subject you to any headaches associated with javascipt window opening. justin __ Justin Ruthenbeck Lead Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential. See: http://www.nextengine.com/confidentiality.php __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Response and file downloads
Just an FYI: I was unable to get the body onLoad() to work properly on both IE5 and Mozilla - forget exactly why but it was supposed to work! Anyway, I instead used an IFRAME (internal frame) which I added to my forms' output stream(the same form the user just clicked submit() on - essentially a reload with new status information updated and a tad-bit-o-extra-output). The little-bit-o-code is below: iframe name=thisIFRAME id=thisIFRAME src=get_doc?key_id=1668 frameBorder=0 width=0 scrolling=no height=0/iframe This creates a hidden(I don't want to argue the metaphysical side of this) window which in effect 'clicks' on the link I created. Works nicely...so far. I'm not a HTML/Javascript guru so I can't tell you how long this trick will work. Good luck --Jonathan Justin Ruthenbeck wrote: At 12:17 PM 11/1/2004, you wrote: I am not sure what you are refering to as atypical or robustness... I meant to say that you could approximate the behavior you were asking for (dual response), but doing so would be hackish. How do other sites generate files on the fly (take it out of a database, or a report just run), on form submit, and send them down the line and not run into this problem? Like fzlists said, you'll see most sites load a page in response to a download request which either provides a link which the user can click on to download the binary content (right click, save as in IE), or that scripts the browser to automatically begin downloading. This is how CNet, Yahoo, and others do this. I see many people posting many places on the net that they are using the response to send a file, a lot of them are getting this IllegalState, but I never really found a followup solution that really fit my needs. Why would the possibility exist to push a file through the response if it leaves you with the ability to go nowhere after? If your browser submits a request and the response is a mp3 (through either URL inspection or Content-Disposition header), the browser will prompt the user to Save/Open/Run/whatever the file (and won't try to display it). Once the file has been saved, it will leave you at the original page from which the file was requested. Point being that after you push binary content through the response, it leaves you with whatever the previous page's options were ... there's really no contradiction in doing so. justin -Original Message- From: Justin Ruthenbeck [mailto:[EMAIL PROTECTED] Sent: Monday, November 01, 2004 2:56 PM To: Tomcat Users List Subject: Re: Response and file downloads Luc, At 11:42 AM 11/1/2004, you wrote: I am having a wee problem with using the response. I have a form on a page, with a submit button to download a file. That file is being pulled from a database and pushed to the response. The problem I am having, I just used that response to submit the page, so I am getting and IllegalStateException, even though it is still pushing the file to the browswer I also want to be able to send a redirect after the file is downloaded (so I can refresh the page so the form submit page is regenerated, since we are using a string to determine unique submits are only coming from the pages we generated, and not the browser address bar) Can we get a new response from the session variable (the one available to jsp writing) to send the file, then get another new response to perform a redirect Basically I want to be able to do something like the form submits, and passes to the applications perform methods through the jsp catching the submit response = new Response response.sendFile response = new Response response.sendRedirect (yes I know those are not actual methods and classes, just trying to explain what I want) Your understanding of how, exactly, the http protocol works is incorrect. Because it is a (single) request, (single) response protocol, what you're asking for cannot be done. It seems like what you want is for a user to fill out a form, click submit, then be presented with a new, fresh, form again ... with the file download on the side. If you have determined that you absolutely want this behavior (it's atypical, so doing it won't be particularly robust), consider programmatically opening another browser window on form submit from which the download will happen ... and reload your form in your main browser window. This will, of course, subject you to any headaches associated with javascipt window opening. justin __ Justin Ruthenbeck Lead Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential. See: http://www.nextengine.com/confidentiality.php __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED
Re: Response and file downloads
You should be aware that IFrames are an IE-only thing. Won't work on any other browser AFAIK. What did you get when you tried onLoad()? Maybe I can gelp get that working. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com Jonathan Wilson wrote: Just an FYI: I was unable to get the body onLoad() to work properly on both IE5 and Mozilla - forget exactly why but it was supposed to work! Anyway, I instead used an IFRAME (internal frame) which I added to my forms' output stream(the same form the user just clicked submit() on - essentially a reload with new status information updated and a tad-bit-o-extra-output). The little-bit-o-code is below: iframe name=thisIFRAME id=thisIFRAME src=get_doc?key_id=1668 frameBorder=0 width=0 scrolling=no height=0/iframe This creates a hidden(I don't want to argue the metaphysical side of this) window which in effect 'clicks' on the link I created. Works nicely...so far. I'm not a HTML/Javascript guru so I can't tell you how long this trick will work. Good luck --Jonathan Justin Ruthenbeck wrote: At 12:17 PM 11/1/2004, you wrote: I am not sure what you are refering to as atypical or robustness... I meant to say that you could approximate the behavior you were asking for (dual response), but doing so would be hackish. How do other sites generate files on the fly (take it out of a database, or a report just run), on form submit, and send them down the line and not run into this problem? Like fzlists said, you'll see most sites load a page in response to a download request which either provides a link which the user can click on to download the binary content (right click, save as in IE), or that scripts the browser to automatically begin downloading. This is how CNet, Yahoo, and others do this. I see many people posting many places on the net that they are using the response to send a file, a lot of them are getting this IllegalState, but I never really found a followup solution that really fit my needs. Why would the possibility exist to push a file through the response if it leaves you with the ability to go nowhere after? If your browser submits a request and the response is a mp3 (through either URL inspection or Content-Disposition header), the browser will prompt the user to Save/Open/Run/whatever the file (and won't try to display it). Once the file has been saved, it will leave you at the original page from which the file was requested. Point being that after you push binary content through the response, it leaves you with whatever the previous page's options were ... there's really no contradiction in doing so. justin -Original Message- From: Justin Ruthenbeck [mailto:[EMAIL PROTECTED] Sent: Monday, November 01, 2004 2:56 PM To: Tomcat Users List Subject: Re: Response and file downloads Luc, At 11:42 AM 11/1/2004, you wrote: I am having a wee problem with using the response. I have a form on a page, with a submit button to download a file. That file is being pulled from a database and pushed to the response. The problem I am having, I just used that response to submit the page, so I am getting and IllegalStateException, even though it is still pushing the file to the browswer I also want to be able to send a redirect after the file is downloaded (so I can refresh the page so the form submit page is regenerated, since we are using a string to determine unique submits are only coming from the pages we generated, and not the browser address bar) Can we get a new response from the session variable (the one available to jsp writing) to send the file, then get another new response to perform a redirect Basically I want to be able to do something like the form submits, and passes to the applications perform methods through the jsp catching the submit response = new Response response.sendFile response = new Response response.sendRedirect (yes I know those are not actual methods and classes, just trying to explain what I want) Your understanding of how, exactly, the http protocol works is incorrect. Because it is a (single) request, (single) response protocol, what you're asking for cannot be done. It seems like what you want is for a user to fill out a form, click submit, then be presented with a new, fresh, form again ... with the file download on the side. If you have determined that you absolutely want this behavior (it's atypical, so doing it won't be particularly robust), consider programmatically opening another browser window on form submit from which the download will happen ... and reload your form in your main browser window. This will, of course, subject you to any headaches associated with javascipt window opening. justin __ Justin Ruthenbeck Lead Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential. See: http://www.nextengine.com/confidentiality.php
Re: Response and file downloads
You should be aware that IFrames are an IE-only thing. Won't work on any other browser AFAIK. Is that true? My impression is that iframes work on Mozilla, too. Anyway, I think you can accomplish the same thing as an IFRAME using an OBJECT tag, so that may be another way to return a page that instructs the client to automatically issue the GET to download the file when the page is returned. David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Response and file downloads
It *is* possible that Mozilla now supports iFrames, I haven't kept up with it's development. I do know for sure that they were originally an IE-only extension, so if Mozilla does support it, it represents a very rare case of Microsoft leading the pack :) I'm not sure about the object tag idea... I've never seen it used that way but that certainly doesn't mean it won't work. My understanding is that it embeds content in a page that is recognized by one plug-in or another... I suspect it wouldn't help in this case, but I could be wrong. Now, if there is a way that I don't know about to target a layer, that could do the trick. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com David Wall wrote: You should be aware that IFrames are an IE-only thing. Won't work on any other browser AFAIK. Is that true? My impression is that iframes work on Mozilla, too. Anyway, I think you can accomplish the same thing as an IFRAME using an OBJECT tag, so that may be another way to return a page that instructs the client to automatically issue the GET to download the file when the page is returned. David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Response and file downloads
IE 4 made Netscape 4 look like a piece of crap. It was light-years ahead. I'm getting the impression that the other browsers have caught up but I refuse to develop for them unless made to. Questions: Have the other browsers caught up with ease and power of their scripting? Do any of them have an XMLHTTP equivalent? Do they share a common DOM? I hate writing cross browser code. Supporting multiple browsers is like having to test and write every application in Java, VB, and C. Chad -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Monday, November 01, 2004 5:29 PM To: Tomcat Users List Subject: Re: Response and file downloads It *is* possible that Mozilla now supports iFrames, I haven't kept up with it's development. I do know for sure that they were originally an IE-only extension, so if Mozilla does support it, it represents a very rare case of Microsoft leading the pack :) I'm not sure about the object tag idea... I've never seen it used that way but that certainly doesn't mean it won't work. My understanding is that it embeds content in a page that is recognized by one plug-in or another... I suspect it wouldn't help in this case, but I could be wrong. Now, if there is a way that I don't know about to target a layer, that could do the trick. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com David Wall wrote: You should be aware that IFrames are an IE-only thing. Won't work on any other browser AFAIK. Is that true? My impression is that iframes work on Mozilla, too. Anyway, I think you can accomplish the same thing as an IFRAME using an OBJECT tag, so that may be another way to return a page that instructs the client to automatically issue the GET to download the file when the page is returned. David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Response and file downloads
Frank W. Zammetti wrote: It *is* possible that Mozilla now supports iFrames, I haven't kept up with it's development. Dude, you need to get out more :-) IFRAME is part of the HTML 4.0 spec: http://www.w3.org/TR/html4/present/frames.html#edef-IFRAME Old news. It works fine in Moz, Opera, Konqueror... I'm not sure about the object tag idea... I've never seen it used that way but that certainly doesn't mean it won't work. My understanding is that it embeds content in a page that is recognized by one plug-in or another... I suspect it wouldn't help in this case, but I could be wrong. And you can use OBJECT to include anything -- text files, HTML files, images, whatever; if it's a browser-native format, it'll just be displayed. Something like this: object type=text/html data=alert-js.html height=100px width=300px /object :: will include the page referenced as data. Now, if there is a way that I don't know about to target a layer, that could do the trick. Still, the most reliable solution for the problem at hand is probably the META refresh... FWIW! -- Hassan Schroeder - [EMAIL PROTECTED] Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com dream. code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Response and file downloads
Hassan Schroeder wrote: Dude, you need to get out more :-) Wife, kids, house, day job, my own company off-hours... Getting out hasn't happened much for about eight years now :) IFRAME is part of the HTML 4.0 spec: http://www.w3.org/TR/html4/present/frames.html#edef-IFRAME Cool, I didn't realize that. Maybe it was just that support for it was not universal until relatively recently. The last time I did any non-IE development frankly was about 3-4 years ago, obviously much could have changed since then. And you can use OBJECT to include anything -- text files, HTML files, images, whatever; if it's a browser-native format, it'll just be displayed. Something like this: object type=text/html data=alert-js.html height=100px width=300px /object :: will include the page referenced as data. That's definitely cool too, I never would have thought to even try it. I assume an object is available through DOM... does it have a src attribute? You know what I'm getting at: dynamic changing of the content. If that's possible, any idea how universal that would be? Still, the most reliable solution for the problem at hand is probably the META refresh... No argument here :) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Response and file downloads
Yeah, even though I don't do much non-IE work these days, the other browsers are at worst comparable (and many would say have far exceeded IE). If you stick to standards-compliant code, there tends to be not much difficulty writing cross-browser code these days. I think there's still enough difference in how things are rendered to make it unpleasant, but it's not nearly as difficult as it used to be. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com Chad Maniccia wrote: IE 4 made Netscape 4 look like a piece of crap. It was light-years ahead. I'm getting the impression that the other browsers have caught up but I refuse to develop for them unless made to. Questions: Have the other browsers caught up with ease and power of their scripting? Do any of them have an XMLHTTP equivalent? Do they share a common DOM? I hate writing cross browser code. Supporting multiple browsers is like having to test and write every application in Java, VB, and C. Chad -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Monday, November 01, 2004 5:29 PM To: Tomcat Users List Subject: Re: Response and file downloads It *is* possible that Mozilla now supports iFrames, I haven't kept up with it's development. I do know for sure that they were originally an IE-only extension, so if Mozilla does support it, it represents a very rare case of Microsoft leading the pack :) I'm not sure about the object tag idea... I've never seen it used that way but that certainly doesn't mean it won't work. My understanding is that it embeds content in a page that is recognized by one plug-in or another... I suspect it wouldn't help in this case, but I could be wrong. Now, if there is a way that I don't know about to target a layer, that could do the trick. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Response and file downloads
-Original Message- From: Justin Ruthenbeck It seems like what you want is for a user to fill out a form, click submit, then be presented with a new, fresh, form again ... with the file download on the side. If you have determined that you absolutely want this behavior (it's atypical, so doing it won't be particularly robust), consider programmatically opening another browser window on form submit from which the download will happen ... and reload your form in your main browser window. This will, of course, subject you to any headaches associated with javascipt window opening. Justin, since I want a basic download, I'd be interested in what you consider typical please? I need to offer the user a list of files (I'd thought of a form or list of links) They select one, then download it. What's the tomcat way please? regards DaveP -- DISCLAIMER: NOTICE: The information contained in this email and any attachments is confidential and may be privileged. If you are not the intended recipient you should not use, disclose, distribute or copy any of the content of it or of any attachment; you are requested to notify the sender immediately of your receipt of the email and then to delete it and any attachments from your system. RNIB endeavours to ensure that emails and any attachments generated by its staff are free from viruses or other contaminants. However, it cannot accept any responsibility for any such which are transmitted. We therefore recommend you scan all attachments. Please note that the statements and views expressed in this email and any attachments are those of the author and do not necessarily represent those of RNIB. RNIB Registered Charity Number: 226227 Website: http://www.rnib.org.uk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]