|
|
|
@ -6,6 +6,7 @@ import com.fr.module.Activator;
|
|
|
|
|
import com.fr.module.ModuleRole; |
|
|
|
|
import com.fr.stable.EncodeConstants; |
|
|
|
|
import com.fr.stable.ProductConstants; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.startup.FineWebApplicationInitializer; |
|
|
|
|
import com.fr.third.springframework.web.SpringServletContainerInitializer; |
|
|
|
|
import com.fr.third.springframework.web.context.support.AnnotationConfigWebApplicationContext; |
|
|
|
@ -26,6 +27,8 @@ import java.util.Set;
|
|
|
|
|
*/ |
|
|
|
|
public class FineEmbedServerActivator extends Activator { |
|
|
|
|
|
|
|
|
|
private static final String TOMCAT_MAX_HEADER_SIZE = "tomcat-maxHttpHeaderSize"; |
|
|
|
|
|
|
|
|
|
private Tomcat tomcat; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -68,6 +71,7 @@ public class FineEmbedServerActivator extends Activator {
|
|
|
|
|
// 8.5.x 请求参数带特殊字符被tomcat拒绝 []|{}^\`"<>
|
|
|
|
|
tomcat.getConnector().setProperty("relaxedQueryChars", "[]|{}^\`"<>"); |
|
|
|
|
setMaxPostSize(); |
|
|
|
|
setMaxHttpHeaderSize(); |
|
|
|
|
String docBase = new File(WorkContext.getCurrent().getPath()).getParent(); |
|
|
|
|
|
|
|
|
|
//内置的上下文使用工程目录比如webroot
|
|
|
|
@ -102,6 +106,17 @@ public class FineEmbedServerActivator extends Activator {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setMaxHttpHeaderSize() { |
|
|
|
|
String value = System.getProperty(TOMCAT_MAX_HEADER_SIZE); |
|
|
|
|
if (StringUtils.isNotEmpty(value)) { |
|
|
|
|
try { |
|
|
|
|
tomcat.getConnector().setProperty("maxHttpHeaderSize", value); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void stopServerActivator() { |
|
|
|
|
|
|
|
|
|