Understanding TomcatResourceServlet

6 views
Skip to first unread message

Bernd Eckenfels

unread,
Sep 28, 2019, 3:59:36 AM9/28/19
to OPS4J
Hallo,

I have two questions regarding the implementation in the TomcatResourceServlet.

First of all it initially checks for response.isCommited and then it also checks in some places before sending errors. It does not check in all places. I wonder should it always check or does it not need to check besides the initial one? It’s not clear what the pattern is, If it is supposed to check every time I would suggest to add a sendError private helper which does the check. Let me know if I should open a Jira/PR for that or if you prefer me removing the commiten checks.

BTW I submitted a trivial JavaDoc fix for copyRange. (I would have also renamed the method since it is not Range aware and therefore the name is missleading, however as the method is protected I chose not to. Let me know if you think such a fix is fine - or if we should try to make it Range aware)

Okay, so with the two housekeeping items out of the way, I have a more serious problem:

when requesting a non normalized URL which happens to be served by the default servlet it gets me the content of the bundle. This happens only on jboss7/jbossosgi and might be due to the way we set it up (in Karaf it does not happen).


I might open a separate issue/discussion for this, but before going into this deeper, I wonder can somebody confirm that requestURI is supposed to be not normalized when the servlet is executed and the exiting code which does for example prefix matches is not optimal? Is there a reason why it does not use pathInfo for example, which is normalized.


This uses mapping.startsWith(context) which won’t work normally with /x/../context/ - or is there some wrappers/valve which is supposed to normalize this against servlet spec?

Gruss
Bernd



Grzegorz Grzybek

unread,
Oct 14, 2019, 2:11:05 AM10/14/19
to op...@googlegroups.com
Hello

Sorry for late answer. I'd like to ask you to create PAXWEB jira issues in https://ops4j1.jira.com/projects/PAXWEB/summary/statistics Jira project. If you have some code fixes, integration tests that ensure correct (or better) behaviour, please create PRs at github.

If you don't have Jira account for PAXWEB (and ops4j Jira), I can assist in creating one.

regards
Grzegorz Grzybek

--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com

---
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 ops4j+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/e43ab5fb-5685-43fb-abe0-769a7af575d3%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages