tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefán F. Stefánsson <stef...@snote.decode.is>
Subject RE: webapp icons, disabling directory listings, and <error-page>tags in web.xml
Date Tue, 27 Feb 2001 15:30:50 GMT
ok.. so the icon should be working?

let me get this straight... If I have a definition in my web.xml that
looks like this:
<web-app>
	<icon>
		<small-icon>/img/iconSmall.gif</small-icon>
		<large-icon>/img/iconLarge.gif</large-icon>
	</icon>
...

and the directory structure for my webapp looks like this:

'webapp_root'-+
              +-'img'-+
              |       +-'iconSmall.gif'
              |       +-'iconLarge.gif'
              |       +-...
              |
              +-'WEB-INF'-+
                          +-'web.xml'
                          +-...

Things should work ok?  Well... they don't... and I've tried to have
both <small-icon>/bla/ble.gif</small-icon> and
<small-icon>bla/ble.gif</small-icon> and nada!  Also the trick you
talked about with the welcome file list is not working, I've also tried
every possible combination of that...  If I put in a <welcome-file-list>
with those things the directory listing appears but if I skip it or do
it with only the index.htm file in it the index.htm file is used, so
it's actually working but not redirecting to the right place.

The things to notice about my setup are:
1) I'm running on an EmbededTomcat fired up from within another app.
2) I'm using https connectors

The other (regular) things are that:
I'm using Win2000, JDK1.3.

This smells like some sort of bug to me but just in case I'm going to
append the contents of the web.xml file I'm using:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app>
	<icon>
		<small-icon>img/iconSmall.gif</small-icon>
		<large-icon>img/iconLarge.gif</large-icon>
	</icon>
	
	<display-name>IPS Web Application</display-name>
	
	<description>The webservice of the IPS system</description>
	
	<servlet>
		<servlet-name>Controller</servlet-name>
	
<servlet-class>com.decode.ips.webservice.controller.IPSControllerServlet
</servlet-class>
	</servlet>
	
	<servlet-mapping>
		<servlet-name>Controller</servlet-name>
		<url-pattern>/logon</url-pattern>
	</servlet-mapping>

	<welcome-file-list>
		<welcome-file>index.htm</welcome-file>
	</welcome-file-list>
	
	<error-page>
		<error-code>javax.servlet.ServletException</error-code>
		<location>/error.jsp</location>
	</error-page>
	
</web-app>


Hopefully someone can find something wrong with my setup here...
otherwise this is a bug.

Kind regards and thanks for all your help.

Stefan.

-----Original Message-----
From: Fernando Padilla [mailto:fern@interdimensions.com]
Sent: 27. febrúar 2001 14:27
To: Tomcat-User
Subject: Re: webapp icons, disabling directory listings, and
<error-page>tags in web.xml



Stefan,

The web.xml file is completely defined as part of the Servlet 2.2
Specification, when it defines Web Applications. Go there for the
official
reference.


On Tue, 27 Feb 2001, Stefán F. Stefánsson wrote:

> Hello.
>
> I was wondering if anyone knows if the <icon> element in web.xml is
not
> working in Tomcat (it's not working for me... just wondering if it's
not
> supported or if it's something specific with me).

??? report a reproducable bug please, and someone should handle it.
don't forget the icon file has to be relative to the webapp root.


> Another thing (a little more important) is the <welcome-file-list>
> element.  I have one such in my web.xml and it contains one
> <welcome-file> element.  This is directly from it:
>
> <welcome-file-list>
>
>
<welcome-file>/servlet/com.decode.ips.webservice.controller.IPSControlle
> rServlet</welcome-file>
> </welcome-file-list>

Again, the tag says, welcome-file, you define a file to map to, if it is
present.  There is no servlet/... file present.  One trick is to map it
to
<welcome-file>index.servlet</welcome-file>

then do a <servlet-mapping> mapping index.servlet to your
JSPControllerServlet.  And for further assurance, you can create an
index.servlet file, to encourage it, but really it should map to the
servlet eventually.


fern


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-user-help@jakarta.apache.org


Mime
View raw message