提交 ef2c53d4 编写于 作者: K kohsuke

implemented 1.66.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1279 71c3de6d-444a-0410-be80-ed276b4c234a
上级 0a05b428
......@@ -7,6 +7,7 @@ import hudson.model.User;
import hudson.triggers.Trigger;
import hudson.util.IncompatibleVMDetected;
import hudson.util.RingBufferLogHandler;
import hudson.util.IncompatibleServletVersionDetected;
import javax.naming.Context;
import javax.naming.InitialContext;
......@@ -14,6 +15,7 @@ import javax.naming.NamingException;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.ServletResponse;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerFactoryConfigurationError;
import java.io.File;
......@@ -50,6 +52,14 @@ public class WebAppMain implements ServletContextListener {
return;
}
// make sure this is servlet 2.4 container or above
try {
ServletResponse.class.getMethod("setCharacterEncoding",String.class);
} catch (NoSuchMethodException e) {
context.setAttribute("app,",new IncompatibleServletVersionDetected());
return;
}
// Tomcat breaks XSLT with JDK 5.0 and onward. Check if that's the case, and if so,
// try to correct it
try {
......
package hudson.util;
/**
* Model object used to display the error top page if
* we find out that the container doesn't support servlet 2.4.
*
* <p>
* <tt>index.jelly</tt> would display a nice friendly error page.
*
* @author Kohsuke Kawaguchi
*/
public class IncompatibleServletVersionDetected {
}
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<l:layout>
<l:header title="Hudson" />
<l:side-panel />
<l:main-panel>
<h1><img src="${rootURL}/images/48x48/error.gif" alt="[!]"/><st:nbsp/>Error</h1>
<p>
We detected that your servlet container does not support Servlet 2.4.
</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.
先完成此消息的编辑!
想要评论请 注册