Am Dienstag, den 15.12.2009, 15:01 +0000 schrieb Pid: > o right to my problem, wich I am sure is not too unusual, but I > > couldn't really find a solution (via google) so far. > > > > my directory structure looks as follows > > > > /opt/document-repository<- mounted nfs-disk of an archiving system > > > > /opt/Tomcat/webapps/myApp.war<- my project deployment file > > > > my webapp for now is just a bunch of servlets which, using > > java.io.File..., have no trouble to read the archiving systems > directory > > structure listing to list all available archived pdf-files. With > > servlets and some CSS I managed to build a little directory tree in > the > > browser output and linked the pdf-files to get opened (via adobe > reader > > plugin) in an iframe > > > > this basically works if the pdf-files I want to open are located in > the > > deployment directory. > > > > but what I want to do is to access the pdf-files of the archiving > disk. > > it seems tho while the servlet java code {java.io...} CAN, tomcat > CANNOT > > access the pdf-files, which are stored there. And my projects > deployment > > directory and the archiving systems mount have to be separated, so I > can > > not mount the nfs into the deployment directory nor can I put my > > application around the nfs-mount-directory > > > > I stumbled over a hint about adding a > > > > <Context docBase="/opt/documents" path="/documents"/> > > > > directive to the web.xml file, but I haven't had any luck with my > > experiments so far, but then I realized that this would mean that I > also > > have to move my project directory which I can't. > > > > So if there is any possibility to get this done (i am using linux > incase > > you haven't guessed already) I would be very glad if anyone could > drop a > > few lines to help me out. > > What actually happens when you try to access the files? > Does the Tomcat process have sufficient rights to access that > directory? > >
http://localhost:8080/myApp/PDFClient <- entry servlet and main form http://localhost:8080/myApp/PDFViewer <- servlet loaded in IFrame ok when I click on a linked PDF e. g. <a href="http://localhost:8080/myApp/PDFViewer?file=document-repository/Folder%202/TestDok4.pdf&page=1" target="viewer-iframe">filename</a> in the PDFClient the PDFViewer should be loaded in the IFrame, which actually is a blank page that just embeds the PDF-File ...process request-parameters and session-vars... if(pdfFile!=null) { output = "<embed src=\""+pdfFile+"#page="+pdfPage +"&toolbar=0&navpanes=0&scrollbar=0&view=Fit\" width= \"550\" height=\"550\">"; } When I call the Viewer with a file 'TestDok1.pdf' which is located in the 'war' file (main directory of the project), it works well, when a pdf-file from a location outside the project directory the generated html looks like it should: <html> <head> <title>PDFViewer</title> </head> <body> <embed src="document-repository/TestDok1.pdf#page=1&toolbar=0&navpanes=0&scrollbar=0&view=Fit" width="550" height="550"> </body> </html> but instead of opening the PDF-File the plugin opens nothing... well at least it reserves the 550x550 pixels for the presentation but all is white nothing is displayed /opt and recursively all contents have rwxrwxrwx... so I would think the access rights should not be the problem... Thx for the quick answer! Ingo
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil