提交 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 {
try {
ServletResponse.class.getMethod("setCharacterEncoding",String.class);
} catch (NoSuchMethodException e) {
context.setAttribute(APP,new IncompatibleServletVersionDetected());
context.setAttribute(APP,new IncompatibleServletVersionDetected(ServletResponse.class));
return;
}
......
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
* we find out that the container doesn't support servlet 2.4.
......@@ -10,4 +15,13 @@ package hudson.util;
* @author Kohsuke Kawaguchi
*/
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 @@
<l:main-panel>
<h1><img src="${imagesURL}/48x48/error.gif" alt="[!]"/><st:nbsp/>Error</h1>
<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>
</l:main-panel>
</l:layout>
</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.
先完成此消息的编辑!
想要评论请 注册