diff options
author | James Moger <james.moger@gitblit.com> | 2014-05-23 08:17:11 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-07-03 16:57:47 -0400 |
commit | c828cf2db88956094a31a79741145688876879df (patch) | |
tree | 7f9d7e8b0fe7d91350afb79b2baf60f543712150 /src/main/java/WEB-INF | |
parent | aa1361d04cfe09f90e7d8bece90c00dd6e4185bb (diff) | |
download | gitblit-c828cf2db88956094a31a79741145688876879df.tar.gz gitblit-c828cf2db88956094a31a79741145688876879df.zip |
Use Guice-Servlet rather than custom code and expose the Injector
This is a fairly functional variation of Gitblit with one notable
exception:
The security filters are not working properly.
This is a design flaw in Guice that I have reported upstream [1]. The
general idea is that Guice-Servlet filters are not properly wrapping the
ServletRequest. This has historically been a problem for Guice-Servlet
servlets but Google has fixed most of those issues. Unfortunately, all
the same flaws reported against the servlet delegation also exist in
Guice-Servlet filter delegation. :(
[1]: https://code.google.com/p/google-guice/issues/detail?id=807
Diffstat (limited to 'src/main/java/WEB-INF')
-rw-r--r-- | src/main/java/WEB-INF/web.xml | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/main/java/WEB-INF/web.xml b/src/main/java/WEB-INF/web.xml index 2a570e32..88422249 100644 --- a/src/main/java/WEB-INF/web.xml +++ b/src/main/java/WEB-INF/web.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> -<web-app version="3.0" +<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd"> + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <!-- The base folder is used to specify the root location of your Gitblit data. @@ -32,4 +32,18 @@ <!-- Gitblit Displayname --> <display-name>Gitblit - @gb.version@</display-name> + <listener> + <listener-class>com.gitblit.servlet.GitblitContext</listener-class> + </listener> + + <filter> + <filter-name>guiceFilter</filter-name> + <filter-class>com.google.inject.servlet.GuiceFilter</filter-class> + </filter> + + <filter-mapping> + <filter-name>guiceFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + </web-app>
\ No newline at end of file |