diff --git a/src/main/java/com/monkeyk/sos/web/context/SOSServletContextAware.java b/src/main/java/com/monkeyk/sos/web/context/SOSServletContextAware.java new file mode 100644 index 0000000..3fd6dc8 --- /dev/null +++ b/src/main/java/com/monkeyk/sos/web/context/SOSServletContextAware.java @@ -0,0 +1,24 @@ +package com.monkeyk.sos.web.context; + +import com.monkeyk.sos.web.WebUtils; +import org.springframework.stereotype.Component; +import org.springframework.web.context.ServletContextAware; + +import javax.servlet.ServletContext; + +/** + * 2021/10/23 12:16 PM + * + * @author Shengzhao Li + * @since 2.1.1 + */ +@Component +public class SOSServletContextAware implements ServletContextAware { + + + @Override + public void setServletContext(ServletContext servletContext) { + //主版本号 + servletContext.setAttribute("mainVersion", WebUtils.VERSION); + } +}