Adding prelude-include seems to break default welcome file list
posted 7 years ago
I want to use include-prelude to include a file at the beginning of each page in a particular folder of a webapp (/mywebapp/admin). When I specify an include-prelude for all jsp files with the url-pattern *.jsp, it functions as expected. But when I specify a second include-prelude, restricting the path with the url-pattern /admin/*, I am no longer able to browse to the directory without specifying a filename like index.jsp.
From my web.xml:
If I browse to localhost:8080/mywebapp/admin (without trailing path separator), I get a server exception:
org.apache.jasper.JasperException: File "/admin" not found
If I add a trailing path separator, I get a 404 error:
The requested resource (/PIMS-Zambia/admin/) is not available.
I thought maybe it had something to do with welcome files (wild ass guess, reaching beyond my understanding of the situation). I added an explicit welcome-file-list to web.xml:
With the welcome-file-list, now I can browse to localhost:8080/mywebapp/admin/ and it displays index.jsp successfully, but if I remove the trailing slash I get the server exception again.