From: James Moger Date: Sat, 8 Oct 2011 01:08:52 +0000 (-0400) Subject: Updated servlet-api to 3.0 and ported ServletRequestWrapper (issue 23) X-Git-Tag: v0.7.0~89^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bd9800b7d52c13a46e4fbc5c6e9ff0d583f5f2fd;p=gitblit.git Updated servlet-api to 3.0 and ported ServletRequestWrapper (issue 23) --- diff --git a/.classpath b/.classpath index cb616da7..8d2ad71a 100644 --- a/.classpath +++ b/.classpath @@ -9,7 +9,6 @@ - @@ -97,5 +96,6 @@ + diff --git a/docs/00_index.mkd b/docs/00_index.mkd index 17ca428e..cf165db5 100644 --- a/docs/00_index.mkd +++ b/docs/00_index.mkd @@ -30,6 +30,7 @@ Gitblit requires a Java 6 Runtime Environment (JRE) or a Java 6 Development Kit - improved: updated ui with Twitter's Bootstrap CSS toolkit
**New:** *web.loginMessage = gitblit* +- fixed: Gitblit now runs on Servlet 3.0 webservers (e.g. Tomcat 7, Jetty 8) - fixed: Set the RSS content type for Firefox 4 (issue 22) - fixed: Null pointer exception if did not set federation strategy (issue 20) - fixed: Gitblit GO allows SSL renegotiation if running on Java 1.6.0_22 or later diff --git a/docs/04_releases.mkd b/docs/04_releases.mkd index 01b531d6..214e35cb 100644 --- a/docs/04_releases.mkd +++ b/docs/04_releases.mkd @@ -5,6 +5,7 @@ - improved: updated ui with Twitter's Bootstrap CSS toolkit
**New:** *web.loginMessage = gitblit* +- fixed: Gitblit now runs on Servlet 3.0 webservers (e.g. Tomcat 7, Jetty 8) - fixed: Set the RSS content type for Firefox 4 (issue 22) - fixed: Null pointer exception if did not set federation strategy (issue 20) - fixed: Gitblit GO allows SSL renegotiation if running on Java 1.6.0_22 or later diff --git a/src/com/gitblit/ServletRequestWrapper.java b/src/com/gitblit/ServletRequestWrapper.java index 9110ebf7..d74a9ecb 100644 --- a/src/com/gitblit/ServletRequestWrapper.java +++ b/src/com/gitblit/ServletRequestWrapper.java @@ -19,15 +19,24 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.security.Principal; +import java.util.Collection; import java.util.Enumeration; import java.util.Locale; import java.util.Map; +import javax.servlet.AsyncContext; +import javax.servlet.DispatcherType; import javax.servlet.RequestDispatcher; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; import javax.servlet.ServletInputStream; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import javax.servlet.http.Part; /** * ServletRequestWrapper is a pass-through/delegate wrapper class for a servlet @@ -324,4 +333,68 @@ public abstract class ServletRequestWrapper implements HttpServletRequest { public boolean isRequestedSessionIdFromUrl() { return req.isRequestedSessionIdFromUrl(); } + + /* + * Servlet 3.0 Methods + */ + + @Override + public boolean authenticate(HttpServletResponse response) throws IOException, ServletException { + return false; + } + + @Override + public void login(String username, String password) throws ServletException { + } + + @Override + public void logout() throws ServletException { + } + + + @Override + public Part getPart(String arg0) throws IOException, ServletException { + return req.getPart(arg0); + } + + @Override + public Collection getParts() throws IOException, ServletException { + return req.getParts(); + } + + @Override + public AsyncContext getAsyncContext() { + return req.getAsyncContext(); + } + + @Override + public DispatcherType getDispatcherType() { + return req.getDispatcherType(); + } + + @Override + public ServletContext getServletContext() { + return req.getServletContext(); + } + + @Override + public boolean isAsyncStarted() { + return req.isAsyncStarted(); + } + + @Override + public boolean isAsyncSupported() { + return req.isAsyncStarted(); + } + + @Override + public AsyncContext startAsync() throws IllegalStateException { + return req.startAsync(); + } + + @Override + public AsyncContext startAsync(ServletRequest arg0, ServletResponse arg1) + throws IllegalStateException { + return req.startAsync(arg0, arg1); + } } \ No newline at end of file diff --git a/src/com/gitblit/build/Build.java b/src/com/gitblit/build/Build.java index 684f2787..c4f373e8 100644 --- a/src/com/gitblit/build/Build.java +++ b/src/com/gitblit/build/Build.java @@ -361,10 +361,10 @@ public class Build { "bc75f05dd4f7fa848720ac669b8b438ee4a6b146", "dcd42f672e734521d1a6ccc0c2f9ecded1a1a281"); - public static final MavenObject SERVLET = new MavenObject("Servlet 2.5", "javax/servlet", - "servlet-api", "2.5", 105000, 158000, 0, - "5959582d97d8b61f4d154ca9e495aafd16726e34", - "021599814ad9a605b86f3e6381571beccd861a32", null); + public static final MavenObject SERVLET = new MavenObject("Servlet 3.0", "org/glassfish", + "javax.servlet", "3.0.1", 84000, 211000, 0, + "58f17c941cd0607bb5edcbcafc491d02265ac9a1", + "63f2f8bcdd3f138020bbadd5c847e8f3847b77d2", null); public static final MavenObject SLF4JAPI = new MavenObject("SLF4J API", "org/slf4j", "slf4j-api", "1.6.1", 25500, 45000, 182000,