You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by kkus <kk...@hotmail.com> on 2007/01/01 06:31:31 UTC

How to set up a special folder to list all files under it?

My current setting is redirect default request (localhost:8080) to my app by
adding a refresh meta in index.html under Root. Now I need add a specific
folder which will let user to browse all files under it without
authentication. This folder can be under my app folder or root folder (I
don't care under which context it is, just make sure user can access and
browse files under it). I am with 5.5.20 service of XP Pro SP2 box. Can
anyone give me some hints? Thanks!
-- 
View this message in context: http://www.nabble.com/How-to-set-up-a-special-folder-to-list-all-files-under-it--tf2903441.html#a8112028
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: How to set up a special folder to list all files under it?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: kkus [mailto:kk_us@hotmail.com] 
> Subject: RE: How to set up a special folder to list all files 
> under it?
> 
> Under listing directory, is there any way putting a file link 
> there since I want to put physical file in a different disk?

This isn't really a Tomcat issue.  The Windows implementation of soft
links is a bit strange, as you're finding out.  However, there are ways
to make it work, mostly.  Try looking at this:
http://shell-shocked.org/article.php?id=284

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to set up a special folder to list all files under it?

Posted by kkus <kk...@hotmail.com>.
How can I use this feature of virtual directory in 5.5.20? Any example or
docs? I don't have Apache installed or IIS associated with Tomcat in my box.


Michael Hencin wrote:
> 
> 
> 
> Hello, I noticed the mention of symbolic links and it was
> similar enough to what I did in our application to provide a kind of
> "symbolic link" in our application. The method I cam up with allowed
> the user to user tomcat, and then also create a directory outside the
> context
> of our web app that is used to store files. We allow users to attach files
> within our application that are related to database entries. 
> 
> 
> The problem we had was that we wanted to have a location
> deliberately outside the context of the web app for two reasons. 1)
> Redeployment
> risked deleting the saved files (they act as an archive and must be saved)
> 2)
> disk location growth. These files can be very large, and we wanted to
> provide a
> way to let the end users easily place them on another volume or disk. So
> we now
> have the users create a virtual directory. We use apache web server. This
> virtual directory is linked to the file location. then we have them enter
> that
> virtual directory path into our database, and its served up on the pages.
> This
> then lets the users follow the link to the virtual directory, and apache
> takes
> care of the listings. 
> 
> 
> We do not use apache as a front end at all, just in this case
> we use its virtual directory feature. Tomcat does a fine enough job of the
> web
> serving we need. but in this once case, where we wanted to show files i a
> difference place, not in the context of the web app I came up with this
> kind of
> work around. Before that we just used a UNC path stored in the database,
> but it
> did not work well with firebird and safari, and users outside the network
> could
> not follow the UNC link. 
> 
> 
>  
> 
> 
> This method of using a virtual directory from apache (or IIS
> ) seems to work nicely.
> 
> 
>  
> ---
> Michael Hencin
> President - Enginuity Development Inc.
> michael.hencin@edm-concepts.com
> P: 815-301-9939
> F: 815-301-2007
> 
> ----- Original Message ----
> From: "Caldarale, Charles R" <Ch...@unisys.com>
> To: Tomcat Users List <us...@tomcat.apache.org>
> Sent: Monday, January 1, 2007 12:48:16 AM
> Subject: RE: How to set up a special folder to list all files under it?
> 
>> From: kkus [mailto:kk_us@hotmail.com] 
>> Subject: How to set up a special folder to list all files under it?
>> 
>> Now I need add a specific folder which will let user to browse
>> all files under it without authentication.
> 
> I haven't personally tried the following, so take it with a grain of
> salt.  Also, others might know an easier way to accomplish what you
> want.
> 
> Delivery of static content and directory listings is under control of
> the default servlet, as defined in the conf/web.xml file.  By default,
> this has the listings param set to false, to disable ad hoc browsing.  I
> think you could copy the config for the default servlet, change
> <servlet-name> from default to something appropriate for your purpose,
> set the listings param to true, and add a servlet mapping for this
> renamed default to use a <url-pattern> pointing to the directory you
> want to store your public files in.  You would want to put this
> redefined servlet definition and mapping in the WEB-INF/web.xml of the
> webapp that will hold the public directory.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 
> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-set-up-a-special-folder-to-list-all-files-under-it--tf2903441.html#a8127336
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to set up a special folder to list all files under it?

Posted by Mark Thomas <ma...@apache.org>.
Caldarale, Charles R wrote:
>> From: Mark Thomas [mailto:markt@apache.org] 
>> Subject: Re: How to set up a special folder to list all files 
>> under it?
>>
>> Have a look at 
>> http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
>>
>> you want the allowLinking attribute
> 
> The OP is running on WinXP; is allowLinking safe to use on that platform
> now?  The doc seems pretty adamant about not enabling it for Windows.

Sorry should have read the post more closely. No - this is not safe on
Windows.

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: How to set up a special folder to list all files under it?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mark Thomas [mailto:markt@apache.org] 
> Subject: Re: How to set up a special folder to list all files 
> under it?
> 
> Have a look at 
> http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
> 
> you want the allowLinking attribute

The OP is running on WinXP; is allowLinking safe to use on that platform
now?  The doc seems pretty adamant about not enabling it for Windows.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to set up a special folder to list all files under it?

Posted by Mark Thomas <ma...@apache.org>.
kkus wrote:
> Under listing directory, is there any way putting a file link there since I
> want to put physical file in a different disk? I tried and it showed me a
> file with a link, but after I clicked this test.lnk it can't show me the
> physical file at all. Thanks!

Have a look at http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

you want the allowLinking attribute

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: How to set up a special folder to list all files under it?

Posted by kkus <kk...@hotmail.com>.
Under listing directory, is there any way putting a file link there since I
want to put physical file in a different disk? I tried and it showed me a
file with a link, but after I clicked this test.lnk it can't show me the
physical file at all. Thanks!


Caldarale, Charles R wrote:
> 
>> From: Caldarale, Charles R 
>> Subject: RE: How to set up a special folder to list all files 
>> under it?
>> 
>> You don't have to create any classes.  Just do what I said in 
>> the original response, which is to copy the existing 
>> declaration for the default servlet from conf/web.xml to your 
>> own WEB-INF/web.xml.
> 
> In case I didn't make it clear before, the idea is to create a copy of
> the default servlet specifically for your webapp.  This renamed copy
> will allow access to and listings of the directory specified in its
> <url-pattern>, and nothing else.  The normal default servlet would
> continue to supply static content for all other paths, without exposing
> their directory structure.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-set-up-a-special-folder-to-list-all-files-under-it--tf2903441.html#a8118643
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: How to set up a special folder to list all files under it?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: kkus [mailto:kk_us@hotmail.com] 
> Subject: Re: How to set up a special folder to list all files 
> under it?
> 
> Still confused with servlet class 
> (FullPackageNameOfServletClass) here. What
> is required in building such a class?

You don't have to create any classes.  Just do what I said in the
original response, which is to copy the existing declaration for the
default servlet from conf/web.xml to your own WEB-INF/web.xml.  Change
the name of the servlet, but not the servlet class - leave that as:
    org.apache.catalina.servlets.DefaultServlet

Also change the <param-value> for listings to true (in your copy), and
supply a servlet mapping for the renamed servlet to use the directory
that has your public files.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to set up a special folder to list all files under it?

Posted by kkus <kk...@hotmail.com>.
Still confused with servlet class (FullPackageNameOfServletClass) here. What
is required in building such a class? Can you provide a sample? Thanks!


Martin Gainty wrote:
> 
> 1)yes you need to setup the listings options for your servlet in web.xml
> as in 
>    <servlet>
>        <servlet-name>NameOfServlet</servlet-name>
>        </servlet-class>FullPackageNameOfServletClass</servlet-class>
>         <init-param>
>             <param-name>listings</param-name>
>             <param-value>true</param-value>
>         </init-param>
>   </servlet>
> 2)make sure you copy your viewable (txt) files to the the
> webapps/WEBAPPNAME (Note the WEB-INF folder is for web.xml, /classes and
> /lib)
>  ${contextPath}/src/org/ajaxtags/demo/servlet/AutocompleteServlet.java.txt
> Java source 
> 3)ensure the files that you wish to view have an extension that your
> browser will know to associate with text editor(as in .txt extension for
> vi or wordpad)
> 
> (Expanding on previous poster's extremely late nite posting..)
> 
> M-
> --------------------------------------------------------------------------- 
> This e-mail message (including attachments, if any) is intended for the
> use of the individual or entity to which it is addressed and may contain
> information that is privileged, proprietary , confidential and exempt from
> disclosure. If you are not the intended recipient, you are notified that
> any dissemination, distribution or copying of this communication is
> strictly prohibited.
> --------------------------------------------------------------------------- 
> Le présent message électronique (y compris les pièces qui y sont annexées,
> le cas échéant) s'adresse au destinataire indiqué et peut contenir des
> renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le
> destinataire de ce document, nous vous signalons qu'il est strictement
> interdit de le diffuser, de le distribuer ou de le reproduire.
> ----- Original Message ----- 
> From: "Caldarale, Charles R" <Ch...@unisys.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Monday, January 01, 2007 1:48 AM
> Subject: RE: How to set up a special folder to list all files under it?
> 
> 
>> From: kkus [mailto:kk_us@hotmail.com] 
>> Subject: How to set up a special folder to list all files under it?
>> 
>> Now I need add a specific folder which will let user to browse
>> all files under it without authentication.
> 
> I haven't personally tried the following, so take it with a grain of
> salt.  Also, others might know an easier way to accomplish what you
> want.
> 
> Delivery of static content and directory listings is under control of
> the default servlet, as defined in the conf/web.xml file.  By default,
> this has the listings param set to false, to disable ad hoc browsing.  I
> think you could copy the config for the default servlet, change
> <servlet-name> from default to something appropriate for your purpose,
> set the listings param to true, and add a servlet mapping for this
> renamed default to use a <url-pattern> pointing to the directory you
> want to store your public files in.  You would want to put this
> redefined servlet definition and mapping in the WEB-INF/web.xml of the
> webapp that will hold the public directory.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-set-up-a-special-folder-to-list-all-files-under-it--tf2903441.html#a8115081
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: mod_jk.dll Support

Posted by Martin Gainty <mg...@hotmail.com>.
dong-

download from Apache HTTP Server at
http://httpd.apache.org/download.cgi
mod_jk.dll is windows
mod_jk-apache-2.2.3.so is Unix

HTH
Martin --
--------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "Mark Thomas" <ma...@apache.org>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Monday, January 01, 2007 7:27 PM
Subject: Re: mod_jk.dll Support


> JiaDong Huang wrote:
>> Hi,
>> 
>> I can not find the mod_jk.dll from jk-1.2.20 build. Does it mean that is not
>> supported any more? Or I should use the mod_jk-apache-2.2.3.so instead?
>> 
>> Thanks!
>> 
>> Dong
> 
> When starting a new thread (ie sending a message to the list about a
> new topic) please do not reply to an existing message and change the
> subject line. To many of the list archiving services and mail clients
> used by list subscribers this  makes your new message appear as part
> of the old thread. This makes it harder for other users to find
> relevant information when searching the lists.
> 
> This is known as thread hijacking and is behaviour that is frowned
> upon on this list. Frequent offenders will be removed from the list.
> It should also be noted that many list subscribers automatically
> ignore any messages that hijack another thread.
> 
> The correct procedure is to create a new message with a new subject.
> This will start a new thread.
> 
> Mark
> tomcat-user-owner
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
>

Re: mod_jk.dll Support

Posted by Mark Thomas <ma...@apache.org>.
JiaDong Huang wrote:
> Hi,
> 
> I can not find the mod_jk.dll from jk-1.2.20 build. Does it mean that is not
> supported any more? Or I should use the mod_jk-apache-2.2.3.so instead?
> 
> Thanks!
> 
> Dong

When starting a new thread (ie sending a message to the list about a
new topic) please do not reply to an existing message and change the
subject line. To many of the list archiving services and mail clients
used by list subscribers this  makes your new message appear as part
of the old thread. This makes it harder for other users to find
relevant information when searching the lists.

This is known as thread hijacking and is behaviour that is frowned
upon on this list. Frequent offenders will be removed from the list.
It should also be noted that many list subscribers automatically
ignore any messages that hijack another thread.

The correct procedure is to create a new message with a new subject.
This will start a new thread.

Mark
tomcat-user-owner


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


mod_jk.dll Support

Posted by JiaDong Huang <jh...@optusnet.com.au>.
Hi,

I can not find the mod_jk.dll from jk-1.2.20 build. Does it mean that is not
supported any more? Or I should use the mod_jk-apache-2.2.3.so instead?

Thanks!

Dong


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to set up a special folder to list all files under it?

Posted by Martin Gainty <mg...@hotmail.com>.
1)yes you need to setup the listings options for your servlet in web.xml as in 
   <servlet>
       <servlet-name>NameOfServlet</servlet-name>
       </servlet-class>FullPackageNameOfServletClass</servlet-class>
        <init-param>
            <param-name>listings</param-name>
            <param-value>true</param-value>
        </init-param>
  </servlet>
2)make sure you copy your viewable (txt) files to the the webapps/WEBAPPNAME (Note the WEB-INF folder is for web.xml, /classes and /lib)
<a href="${contextPath}/src/org/ajaxtags/demo/servlet/AutocompleteServlet.java.txt">Java source</a>
3)ensure the files that you wish to view have an extension that your browser will know to associate with text editor(as in .txt extension for vi or wordpad)

(Expanding on previous poster's extremely late nite posting..)

M-
--------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "Caldarale, Charles R" <Ch...@unisys.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Monday, January 01, 2007 1:48 AM
Subject: RE: How to set up a special folder to list all files under it?


> From: kkus [mailto:kk_us@hotmail.com] 
> Subject: How to set up a special folder to list all files under it?
> 
> Now I need add a specific folder which will let user to browse
> all files under it without authentication.

I haven't personally tried the following, so take it with a grain of
salt.  Also, others might know an easier way to accomplish what you
want.

Delivery of static content and directory listings is under control of
the default servlet, as defined in the conf/web.xml file.  By default,
this has the listings param set to false, to disable ad hoc browsing.  I
think you could copy the config for the default servlet, change
<servlet-name> from default to something appropriate for your purpose,
set the listings param to true, and add a servlet mapping for this
renamed default to use a <url-pattern> pointing to the directory you
want to store your public files in.  You would want to put this
redefined servlet definition and mapping in the WEB-INF/web.xml of the
webapp that will hold the public directory.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: How to set up a special folder to list all files under it?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: kkus [mailto:kk_us@hotmail.com] 
> Subject: How to set up a special folder to list all files under it?
> 
> Now I need add a specific folder which will let user to browse
> all files under it without authentication.

I haven't personally tried the following, so take it with a grain of
salt.  Also, others might know an easier way to accomplish what you
want.

Delivery of static content and directory listings is under control of
the default servlet, as defined in the conf/web.xml file.  By default,
this has the listings param set to false, to disable ad hoc browsing.  I
think you could copy the config for the default servlet, change
<servlet-name> from default to something appropriate for your purpose,
set the listings param to true, and add a servlet mapping for this
renamed default to use a <url-pattern> pointing to the directory you
want to store your public files in.  You would want to put this
redefined servlet definition and mapping in the WEB-INF/web.xml of the
webapp that will hold the public directory.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org