RE: Links to external files not in web application
You can still have an http server on the same machine as your application server and create a virtual directory that points to the directory you are creating the reports in. In other words, let's assume your application is creating the reports in a file system directory /pdfReports. You can create a virtual directory in an http servers configuration that points the virtual directory /pdfs to /pdfReports. So when your application generates a Report_20050328.pdf file in /pdfReports it can be linked with: March 28, 2005 This way each time the report is opened (which is done by the browser and not by your struts app) it is served by the http server and not by your application server. This will give you much better performance. If you are trying to detect if this file has been created or not check out java.io.File. Regards, Thad Smith -Original Message- From: Brad Balmer [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 1:38 PM To: 'Struts Users Mailing List' Subject: RE: Links to external files not in web application But my application is also going to create them. My app needs to generate the PDF and save it off so that it won't need to be generated again (they are fairly large, db intensive reports). Many different people/groups need to access these so I thought that the first person in would generate it and save it to a common location. Then, the next user in would see a link to the PDF instead of re-generating it. I didn't want to put it in a directory under the .war file because if/when we upgrade I didn't want to have the possibility of deleting old pdf's. -Original Message- From: Smith, Thad [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 1:25 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Links to external files not in web application Are you expecting the application server that runs your Struts application to serve up these pdf files? If so, this is a no no! Application servers (and servlet containers) are geared to run with lower numbers of more processing intensive threads than a simple http server will. I would recommend putting your pdf files in a virtual directory that can be served directly by an http server (which can be on a different machine than your application server) even if you don't have your application server sitting behind an http server. Than just use a standard html anchor tag to link to the pdf documents (no need to use the struts tags to do this as they are not relevant to your struts application): http://myserver.mydomain.com/pdfs/mypdf.pdf";>Read Me! Regards, Thad Smith P.S. This is the recommended way of serving up the images of your application as well. -Original Message- From: Brad Balmer [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 8:59 AM To: 'Struts Users Mailing List' Subject: Links to external files not in web application Please feel free to scold me if I'm missing something obvious but I can't think of a way to link to files (specifically pdf's) that have already been generated and are sitting in a folder external to any web application. I've tried to create a symbolic link to the directory inside my web application and then link to them as if they were inside the application but my application doesn't see them. Am I missing something or is this not as easy as it seems. Thanks. - 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: Links to external files not in web application
Brad Balmer wrote: Many different people/groups need to access these so I thought that the first person in would generate it and save it to a common location. Then, the next user in would see a link to the PDF instead of re-generating it. I obviously don't know your users, but beware of your expectations for this second user. I'll bet they just go ahead and run the report without checking first! With my experience, assuming people will do something like think ahead is going to cause trouble. Is there any way your app could just store a checksum/timestamp and if the second user requests it, pull it from a cached folder? - Nic. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Links to external files not in web application
But my application is also going to create them. My app needs to generate the PDF and save it off so that it won't need to be generated again (they are fairly large, db intensive reports). Many different people/groups need to access these so I thought that the first person in would generate it and save it to a common location. Then, the next user in would see a link to the PDF instead of re-generating it. I didn't want to put it in a directory under the .war file because if/when we upgrade I didn't want to have the possibility of deleting old pdf's. -Original Message- From: Smith, Thad [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 1:25 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Links to external files not in web application Are you expecting the application server that runs your Struts application to serve up these pdf files? If so, this is a no no! Application servers (and servlet containers) are geared to run with lower numbers of more processing intensive threads than a simple http server will. I would recommend putting your pdf files in a virtual directory that can be served directly by an http server (which can be on a different machine than your application server) even if you don't have your application server sitting behind an http server. Than just use a standard html anchor tag to link to the pdf documents (no need to use the struts tags to do this as they are not relevant to your struts application): http://myserver.mydomain.com/pdfs/mypdf.pdf";>Read Me! Regards, Thad Smith P.S. This is the recommended way of serving up the images of your application as well. -Original Message- From: Brad Balmer [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 8:59 AM To: 'Struts Users Mailing List' Subject: Links to external files not in web application Please feel free to scold me if I'm missing something obvious but I can't think of a way to link to files (specifically pdf's) that have already been generated and are sitting in a folder external to any web application. I've tried to create a symbolic link to the directory inside my web application and then link to them as if they were inside the application but my application doesn't see them. Am I missing something or is this not as easy as it seems. Thanks. - 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: Links to external files not in web application
Are you expecting the application server that runs your Struts application to serve up these pdf files? If so, this is a no no! Application servers (and servlet containers) are geared to run with lower numbers of more processing intensive threads than a simple http server will. I would recommend putting your pdf files in a virtual directory that can be served directly by an http server (which can be on a different machine than your application server) even if you don't have your application server sitting behind an http server. Than just use a standard html anchor tag to link to the pdf documents (no need to use the struts tags to do this as they are not relevant to your struts application): http://myserver.mydomain.com/pdfs/mypdf.pdf";>Read Me! Regards, Thad Smith P.S. This is the recommended way of serving up the images of your application as well. -Original Message- From: Brad Balmer [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 8:59 AM To: 'Struts Users Mailing List' Subject: Links to external files not in web application Please feel free to scold me if I'm missing something obvious but I can't think of a way to link to files (specifically pdf's) that have already been generated and are sitting in a folder external to any web application. I've tried to create a symbolic link to the directory inside my web application and then link to them as if they were inside the application but my application doesn't see them. Am I missing something or is this not as easy as it seems. Thanks. - 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]