You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Artur Rataj <ar...@gmail.com> on 2007/10/23 12:05:32 UTC

Why DefaultServlet listing does not work

Hello. I have the following servlet definition:

    <servlet>
        <servlet-name>Listings</servlet-name>
        <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>0</param-value>
        </init-param>
        <init-param>
            <param-name>listings</param-name>
            <param-value>true</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>Listings</servlet-name>
        <url-pattern>/listings</url-pattern>
    </servlet-mapping>

It did say resource not available until I created a directory `listings' in the
application directory. Then it become to show an empty directory listing.
I then created various files in the directory, but the directory listing
was still empty, even after page reload. What did I wrong?

Best regards,
Artur

---------------------------------------------------------------------
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: Why DefaultServlet listing does not work

Posted by Artur Rataj <ar...@gmail.com>.
Is not the listings option in apps' web.xml enough? I wanted the app
to decide if it allows listings of its servlet.

---------------------------------------------------------------------
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: Why DefaultServlet listing does not work

Posted by Tim Funk <fu...@joedog.org>.
You want listsings=true in web.xml contained in $CATALINA_HOME/conf/web.xml

-Tim


Artur Rataj wrote:
> Hello. I have the following servlet definition:
> 
>     <servlet>
>         <servlet-name>Listings</servlet-name>
>         <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
>         <init-param>
>             <param-name>debug</param-name>
>             <param-value>0</param-value>
>         </init-param>
>         <init-param>
>             <param-name>listings</param-name>
>             <param-value>true</param-value>
>         </init-param>
>         <load-on-startup>1</load-on-startup>
>     </servlet>
> 
>     <servlet-mapping>
>         <servlet-name>Listings</servlet-name>
>         <url-pattern>/listings</url-pattern>
>     </servlet-mapping>
> 
> It did say resource not available until I created a directory `listings' in the
> application directory. Then it become to show an empty directory listing.
> I then created various files in the directory, but the directory listing
> was still empty, even after page reload. What did I wrong?
> 

---------------------------------------------------------------------
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: Why DefaultServlet listing does not work

Posted by Artur Rataj <ar...@gmail.com>.
>
> The way the default servlet works, if it isn't mapped to '/', it won't
> work properky.

Thanks, with that mapping it works.

---------------------------------------------------------------------
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: Why DefaultServlet listing does not work

Posted by Mark Thomas <ma...@apache.org>.
Artur Rataj wrote:
> Hello. I have the following servlet definition:
> 
>     <servlet>
>         <servlet-name>Listings</servlet-name>
>         <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
>         <init-param>
>             <param-name>debug</param-name>
>             <param-value>0</param-value>
>         </init-param>
>         <init-param>
>             <param-name>listings</param-name>
>             <param-value>true</param-value>
>         </init-param>
>         <load-on-startup>1</load-on-startup>
>     </servlet>
> 
>     <servlet-mapping>
>         <servlet-name>Listings</servlet-name>
>         <url-pattern>/listings</url-pattern>
>     </servlet-mapping>
> 
> It did say resource not available until I created a directory `listings' in the
> application directory. Then it become to show an empty directory listing.
> I then created various files in the directory, but the directory listing
> was still empty, even after page reload. What did I wrong?

The way the default servlet works, if it isn't mapped to '/', it won't
work properky.

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