Hi Bob-
in your Tomcat servlet code you can read the file directly 
in this example I am reading fubar.properties from folder /fu/bar
BufferedReader reader = new BufferedReader(new 
FileReader("/fu/bar/fubar.properties"));
(If not you will have to supply URI such as 
http://server:port/WebAppName/RelativePathToFile/filename)
Hope this helps,
Martin --
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- 
From: "Bob Wyatt" <[EMAIL PROTECTED]>
To: "'Tomcat Users List'" <users@tomcat.apache.org>; <[EMAIL PROTECTED]>
Sent: Wednesday, June 21, 2006 10:15 AM
Subject: RE: pdf documents


> Pid,
> 
> I mean that it appears as though the webapp is looking in its own path for
> the pdf, and not the path of pdf files defined for Tomcat...
> 
> The webapp true path would be:
> $CATALINA_HOME/webapps/myapp/jsp/app/C666119.pdf...
> 
> We connect to it by http://myipaddr:8100/myapp
> 
> The app 'myapp' is a third-party application we purchased...
> 
> In this case, we have some myapp applications that pull up a fax log of all
> fax transmissions for a user for the past 60 days. We are providing a link
> in that 'listing' to click to view the fax that was transmitted, which has
> been saved as a pdf file. As we have 150 users, there are hundreds of these
> pdf files out there, and I do not want them under $CATALINA_HOME. It would
> appear that we cannot control (specify) the path in which it searches for
> the pdf files, although Tomcat can when given the proper url
> (http://myipaddr:8100/pdf).
> 
> Can an app supersede the pdf search path, or ignore it entirely? Can this
> 'feature' be disabled?
> 
> Regards,
> 
> Bob
> 
> -----Original Message-----
> From: Pid [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, June 21, 2006 09:53
> To: Tomcat Users List
> Subject: Re: pdf documents
> 
> np
> 
> I don't understand why you're or your webapp is looking here:
> /myapp/jsp/app/C666119.pdf
> 
> when the files are available here:
> /pdf/C666119.pdf
> 
> Is the first a filesystem path, or a web URL?
> When you say "my webapp does not pull it from here", what do you mean by
> that?  Sorry if I came to this late, but what does your webapp do and
> why is it looking there, and not at /pdf/C666119.pdf?
> 
> Is it just a link that you're clicking or does your webapp download/open
> the PDF file?
> 
> 
> 
> 
> 
> Bob Wyatt wrote:
>> Pid,
>> 
>> Thank you very much for this response...
>> 
>> Placing the pdf.xml file in $CATALINA_HOME/conf/Catalina/localhost does
> now
>> allow http://myipaddr:8100/pdf to display the files in the specified
>> directory.
>> 
>> However, my webapp still does not pull it from here; it reports that the
>> resource /myapp/jsp/app/C666119.pdf is unavailable. So I am guessing there
>> is a file within the webapp that is over-riding, or over-ruling the
>> 'default' that is now created?
>> 
>> Can someone provide any advice on where to look next?
>> 
>> Can someone provide some advice on what to do if I want to use more than
> one
>> pdf directory, where the second directory is not a subdirectory of the
>> first?
>> 
>> Regards,
>> 
>> Bob
>> 
>> -----Original Message-----
>> From: Pid [mailto:[EMAIL PROTECTED] 
>> Sent: Wednesday, June 21, 2006 05:04
>> To: Tomcat Users List
>> Subject: Re: pdf documents
>> 
>> Don't you need to put the context file pdf.xml in a different place?
>>  
>>
> $CATALINA_HOME/conf/<engine-prob-Catalina?>/<hostname-maybe-webapp?>/pdf.xml
>> 
>> Once it's there you have to call the correct URL, which will be
>>  <webapp-path>/pdf/<file>.pdf
>> 
>> 
>> 
>> 
>> Bob Wyatt wrote:
>>> Mark,
>>>
>>> I appreciate all of your help and energy on my behalf...
>>>
>>> But alas, this does not work for me...
>>>
>>> "The requested resource (/myapp/jsp/app/C666119.pdf) is not available..."
>>>
>>> I removed the $CATALINA_HOME/webapps/myapp/WEB-INF/pdf.xml, and I
> modified
>>> $CATALINA_HOME/webapps/pdf.xml to read:
>>> # more pdf.xml
>>> <Context docBase="/usr/lg/unformq" path="/pdf" > </Context>
>>>
>>> The test to http://myip:8100/pdf also fails with resource unavailable...
>>>
>>> The log file does not report any errors; the last entries are from the
>>> shutdown and restart of tomcat...
>>>
>>> 2006-06-20 19:24:58 StandardContext[/servlets-examples]ContextListener:
>>> attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Lja
>>> va.lang.String;@38a11b3b')
>>> 2006-06-20 19:24:58 StandardContext[/servlets-examples]ContextListener:
>>> attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Lja
>>> va.lang.String;@66cb5b3c')
>>> 2006-06-20 19:24:58 StandardContext[/servlets-examples]ContextListener:
>>> attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Lja
>>> va.lang.String;@1495b3c')
>>> 2006-06-20 19:24:58 StandardContext[/servlets-examples]SessionListener:
>>> contextDestroyed()
>>> 2006-06-20 19:24:58 StandardContext[/servlets-examples]ContextListener:
>>> contextDestroyed()
>>> 2006-06-20 19:24:58 StandardContext[/jsp-examples]ContextListener:
>>> attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.la
>>> ng.String;@195f9b3d')
>>> 2006-06-20 19:24:58 StandardContext[/jsp-examples]ContextListener:
>>> attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.la
>>> ng.String;@4745b3d')
>>> 2006-06-20 19:24:58 StandardContext[/jsp-examples]ContextListener:
>>> attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.la
>>> ng.String;@345db3d')
>>> 2006-06-20 19:24:58 StandardContext[/jsp-examples]SessionListener:
>>> contextDestroyed()
>>> 2006-06-20 19:24:58 StandardContext[/jsp-examples]ContextListener:
>>> contextDestroyed()
>>> 2006-06-20 19:25:39
>>> StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter:
>> init():
>>> ruleChain: [org.apache.webapp.balan
>>> cer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule:
>> Target
>>> string: News / Redirect URL: http://www.cnn.com], [org.a
>>> pache.webapp.balancer.rules.RequestParameterRule: Target param name:
>>> paramName / Target param value: paramValue / Redirect URL: http
>>> ://www.yahoo.com],
> [org.apache.webapp.balancer.rules.AcceptEverythingRule:
>>> Redirect URL: http://jakarta.apache.org]]
>>> 2006-06-20 19:25:39 StandardContext[/jsp-examples]ContextListener:
>>> contextInitialized()
>>> 2006-06-20 19:25:39 StandardContext[/jsp-examples]SessionListener:
>>> contextInitialized()
>>> 2006-06-20 19:25:39 StandardContext[/servlets-examples]ContextListener:
>>> contextInitialized()
>>> 2006-06-20 19:25:39 StandardContext[/servlets-examples]SessionListener:
>>> contextInitialized()
>>>
>>> Regards,
>>>
>>> Bob
>>>
>>> -----Original Message-----
>>> From: Mark Thomas [mailto:[EMAIL PROTECTED] 
>>> Sent: Tuesday, June 20, 2006 19:14
>>> To: Tomcat Users List
>>> Subject: Re: pdf documents
>>>
>>> Bob Wyatt wrote:
>>>> <Context docBase="/usr/test/pdf" > </Context>
>>> Sorry, I should have read you post more carefully. The above works for
>>> 5.5.x but for 5.0.x you will need
>>> <Context docBase="/usr/test/pdf" path="/pdf" > </Context>
>>>
>>> On this version directory listings are enabled so http://host:port/pdf
>>> should return a directory listing.
>>>
>>>> So I then copied pdf.xml to $CATALINA_HOME/webapps/appname/WEB-INF,
>>> shutdown
>>>> and restarted Tomcat, and I receive the same error message.
>>> I don't think this would ever work. I'd delete this copy of pdf.xml so
>>> it doesn't cause confusion down the road.
>>>
>>> If, after a restart, this still doesn't work have a look in
>>> $CATALINA_HOME/logs and post the relevant sections of the logs.
>>>
>>> Mark
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>> 
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

Reply via email to