Accessing welcome-file list from within the servlet

Hy,

Have checked that in the catalina server is available an attribute with the name "org.apache.catalina.WELCOME_FILES" that gives the list of the welcome files but, this identification is explicit for the catalina.

Is there any standart way to access the welcome-file list from within the servlet (utility classes, etc)? Or the names that are given, in the various servers, for the welcome-files attribute.

Daniel Campelo

[448 byte] By [renkrada] at [2007-10-3 1:26:01]
# 1
* ping *
renkrada at 2007-7-14 18:23:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

I am unaware of one, other than to use a File object to open the web.xml file of the application and parse it yourself.

The welcome file list is to be used for instances where a URL does not point to a specific resource. This is typically not something you need to know about at runtime, that's the server's job.

linxpdaa at 2007-7-14 18:23:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Yes it's true that it's not tipical to refer or have the need to know that information, though in our application we have the need to redirect the user, under certain circunstances, to redirect him to the default/home page defined for that applicaton.

Just have to fnd some workaround...

Daniel Campelo

renkrada at 2007-7-14 18:23:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
I don't even know why you need a workaround. When the user goes to http://yourserver/yourapp, they get the welcome file from that list. So just redirect them to that URL.
DrClapa at 2007-7-14 18:23:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

> I don't even know why you need a workaround. When the

> user goes to http://yourserver/yourapp, they get the

> welcome file from that list. So just redirect them to

> that URL.

Because as i was told (although din't confirmed it, or seen the server acting like that) there is a diference on how the server will behave between "http://yourserver/yourapp" and "http://yourserver/yourapp/".

Depending on the specifierd configuration the server may process the URL if the '/' is specified or not.

Again i reming, not checked by me, so i'm forced to beleave on the person that reported it.

Thanx,

Daniel Campelo

renkrada at 2007-7-14 18:23:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...