|
|
|
@ -12,8 +12,6 @@ import com.fr.third.springframework.web.context.support.AnnotationConfigWebAppli
|
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
|
import org.apache.catalina.Context; |
|
|
|
|
import org.apache.catalina.LifecycleException; |
|
|
|
|
import org.apache.catalina.Wrapper; |
|
|
|
|
|
|
|
|
|
import org.apache.catalina.loader.WebappLoader; |
|
|
|
|
import org.apache.catalina.startup.Tomcat; |
|
|
|
|
|
|
|
|
@ -62,7 +60,7 @@ public class FineEmbedServerActivator extends Activator {
|
|
|
|
|
String docBase = new File(WorkContext.getCurrent().getPath()).getParent(); |
|
|
|
|
String appName = "/" + FRContext.getCommonOperator().getAppName(); |
|
|
|
|
Context context = tomcat.addContext(appName, docBase); |
|
|
|
|
addDefaultServlet(context); |
|
|
|
|
Tomcat.initWebappDefaults(context); |
|
|
|
|
//覆盖tomcat的WebAppClassLoader
|
|
|
|
|
context.setLoader(new FRTomcatLoader()); |
|
|
|
|
|
|
|
|
@ -73,19 +71,6 @@ public class FineEmbedServerActivator extends Activator {
|
|
|
|
|
context.addServletContainerInitializer(initializer, classes); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void addDefaultServlet(Context context) { |
|
|
|
|
|
|
|
|
|
Wrapper defaultServlet = context.createWrapper(); |
|
|
|
|
defaultServlet.setName("default"); |
|
|
|
|
defaultServlet.setServletClass("org.apache.catalina.servlets.DefaultServlet"); |
|
|
|
|
defaultServlet.addInitParameter("debug", "0"); |
|
|
|
|
defaultServlet.addInitParameter("listings", "false"); |
|
|
|
|
defaultServlet.setLoadOnStartup(1); |
|
|
|
|
defaultServlet.setOverridable(true); |
|
|
|
|
context.addChild(defaultServlet); |
|
|
|
|
context.addServletMapping("/","default"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void stopServerActivator() { |
|
|
|
|
|
|
|
|
|