Bob Wyatt wrote:
> Pid,
> 
> Your question sent me hunting, and we were specifying no path at all, so it
> was a relative reference. I have changed it to an absolute reference, and it
> is now working.

Great.

> Can I have multiple docBase assignments in the pdf.xml file for multiple pdf
> file sources (assuming I use different paths and a different absolute path
> name)?

No you can't. Each Context only has one path, and one docBase attribute.

You'd need to decide on what path you wish to assign in the web
application.  I'd recommend having another read of the Tomcat docs about
Contexts, you're on your way to getting it all sorted.

Don't forget, the path in the webapp is based on the filename of the
context .xml file. so /pdf/ is a result of pdf.xml.

/pdf2006/ is a result of pdf2006.xml, (which contains a docBase with a
filesystem url, and a matching path attribute.).



> Thank you Pid, Mark, Martin, Suba, Martin, and David; your willingness to
> help, and the help rendered is greatly appreciated!
> 
> Regards,
> 
> Bob
> 
> -----Original Message-----
> From: Pid [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, June 21, 2006 11:59
> To: Tomcat Users List
> Subject: Re: pdf documents
> 
> 
> Bob Wyatt wrote:
>> Pid,
>>
>> HREF="C666119.pdf"
> 
> OK. The above is a relative path. The client browser (not the webapp) is
> looking in the wrong place, because you aren't telling it the correct path.
> You really need to try to get your head round the difference between
> relative and absolute paths and then, also, file system paths and web URLs.
> 
> The PDFs are currently available under the web URL:
>  http://myipaddr:8100/pdf/C666119.pdf
> 
> which means that the link should refer to href="/pdf/C666119.pdf"
> This would be an absolute path.
> 
> You can't map the file system path (/big/dir/of/pdfs/) to the same web
> URL as the app, because the two can't co-exist in the same place.
> 
>> As no file path is in HREF, and pdf.xml is correct (as exhibited by
>> http://myipaddr:8100/pdf), should I be changing the path from /pdf to
>> /myapp/jsp/app, or are you advocating changing the app so the HREF becomes
>> /usr/lg/unformq/C666119.pdf? This latter one, I have no idea of where or
> how
>> to do it, but that does not mean it cannot be done.
> 
> /usr/lg/unformq/C666119.pdf is a file system path, and therefore not
> accessible to the browser/client.  Once again, the webapp is not looking
> for, searching for, or accessing the PDF files, it's the
> browser/client/user who is.
> 
> Who authored the file/page that contains the list of PDFs? The author of
> the commercial app, or someone in your organisation?
> 
> 
>> Thanks for all of your help!
>>
>> Regards,
>>
>> Bob 
>>
>>
>> -----Original Message-----
>> From: Pid [mailto:[EMAIL PROTECTED] 
>> Sent: Wednesday, June 21, 2006 11:11
>> To: Tomcat Users List
>> Subject: Re: pdf documents
>>
>> Bob Wyatt wrote:
>>> 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...
>> Yes, see below.
>>
>>> The webapp true path would be:
>>> $CATALINA_HOME/webapps/myapp/jsp/app/C666119.pdf...
>> OK, that's a filing system path.
>>
>>> 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).
>> (If I'm understanding this correctly it's not searching for anything.)
>>
>> The user is clicking the PDF link, and getting a 404, yes?
>> If so, do a 'view source' on the HTML page, and tell me what's in the
>> href attribute of the link.
>>
>> Is it href="C666119.pdf" or is it href="/myapp/some/path/C666119.pdf" or
>> something else?
>>
>>> Can an app supersede the pdf search path, or ignore it entirely? Can this
>>> 'feature' be disabled?
>> There's no feature I'm afraid. The myapp isn't aware of the PDF context
>> you've installed to map the filing system to a URL, so it's ignoring it.
>>
>> Either you must configure the app to write the correct URL for each
>> PDF*, or you must map the PDF context to the place that is generated by
>> the app**.
>>
>> *  By altering the HTML to point to the path you defined in pdf.xml.
>> ** By altering context pdf.xml definition to create the correct path.
>>
>>> Regards,
>>>
>>> Bob
>> P.S.   Just reply to the list mate, I'm getting 2 copies...
>>
>>
>>
>>
>>
>>> -----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]
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> 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