Hello
In relation to https://ops4j1.jira.com/browse/PAXWEB-1145 ("Fix welcome
file handling"), I'd like to present my unification solution.
Currently all the containers work differently. Let's assume:
- war is deployed under "/context" context path
- war contains static resources in the below directory structure:
/
/WEB-INF/...
/static/
/misc/
start.txt
- war declares <welcome-file>start.txt</welcome-file>
Now:
- request for http://localhost:8181/context ends with HTTP 302 (correct) -
redirect to "/"
- request for http://localhost:8181/context/ ends with HTTP 404 - wrong,
because it should be case for "directory listing" which we don't enable
- request for http://localhost:8181/context/static ends with HTTP 200 and
0-size response. Wrong, because we rely on
org.osgi.framework.Bundle.getResource() and can't tell if the returned URL
is directory or not
- request for http://localhost:8181/context/static/ ends with HTTP 403 -
correct
- request for http://localhost:8181/context/static/misc ends with HTTP 200
and 0-size response. Wrong.
- request for http://localhost:8181/context/static/misc/ ends with forward
to /static/misc/start.txt (welcome file works, but not on every container.
I.e., only on Undertow)
I fixed the problems and now:
- http://localhost:8181/context and http://localhost:8181/context/ ends
with 403 (directory listing disabled - not relevant IMO with bundles)
- http://127.0.0.1:8181/war-bundle/static ends with HTTP 200 - still
confusing, but I really can't tell whether the path is directory or not
(maybe there's way to do it - I know Felix can list the content, but it
know about JarContent, etc.)
- http://127.0.0.1:8181/war-bundle/static/ ends with HTTP 403 (directory
listing case)
- http://127.0.0.1:8181/war-bundle/static/misc and
http://127.0.0.1:8181/war-bundle/static/misc/ forward to start.txt - in
first case I explicitly verify if 0-sized "input stream from directory
entry" means it's really a directory - by checking all the welcome files
I want to fix this in all versions starting with 4.3.x. What do you think?
best regards and Happy New Year (for all I didn't wish it yet)
Grzegorz Grzybek
--
--
------------------
OPS4J - http://www.ops4j.org - [email protected]
---
You received this message because you are subscribed to the Google Groups
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.