提交 b9873621 编写于 作者: K kohsuke

adding error diagnostics as to where servlet API is loaded from.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5706 71c3de6d-444a-0410-be80-ed276b4c234a
上级 e4f5c557
...@@ -75,7 +75,7 @@ public class WebAppMain implements ServletContextListener { ...@@ -75,7 +75,7 @@ public class WebAppMain implements ServletContextListener {
try { try {
ServletResponse.class.getMethod("setCharacterEncoding",String.class); ServletResponse.class.getMethod("setCharacterEncoding",String.class);
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
context.setAttribute(APP,new IncompatibleServletVersionDetected()); context.setAttribute(APP,new IncompatibleServletVersionDetected(ServletResponse.class));
return; return;
} }
......
package hudson.util; package hudson.util;
import hudson.remoting.Which;
import java.io.File;
import java.io.IOException;
/** /**
* Model object used to display the error top page if * Model object used to display the error top page if
* we find out that the container doesn't support servlet 2.4. * we find out that the container doesn't support servlet 2.4.
...@@ -10,4 +15,13 @@ package hudson.util; ...@@ -10,4 +15,13 @@ package hudson.util;
* @author Kohsuke Kawaguchi * @author Kohsuke Kawaguchi
*/ */
public class IncompatibleServletVersionDetected { public class IncompatibleServletVersionDetected {
private final Class servletClass;
public IncompatibleServletVersionDetected(Class servletClass) {
this.servletClass = servletClass;
}
public File getWhereServletIsLoaded() throws IOException {
return Which.jarFile(servletClass);
}
} }
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
<l:main-panel> <l:main-panel>
<h1><img src="${imagesURL}/48x48/error.gif" alt="[!]"/><st:nbsp/>Error</h1> <h1><img src="${imagesURL}/48x48/error.gif" alt="[!]"/><st:nbsp/>Error</h1>
<p> <p>
We detected that your servlet container does not support Servlet 2.4. We detected that your servlet container does not support Servlet 2.4
(servlet API is loaded from ${it.whereServletIsLoaded})
</p> </p>
</l:main-panel> </l:main-panel>
</l:layout> </l:layout>
</j:jelly> </j:jelly>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册