function getContextPath() { var pathName = document.location.pathname; var index = pathName.substr(1).indexOf("/"); var result = pathName.substr(0,index+1); return result;}
Html: <li><a href="#" v-on:click="typeStyle">萨克斯萨克<span></span></a></li> Js: typeStyle: function (e) { var el = e.target; el.style.backgroundColor = 'green'; $(el).css("border","1px so
Spring boot Freemarker 获取ContextPath的两种方法: 1.自定义viewResolver,Spring boot中有一个viewResolver,这个和配置文件中的师徒解析器是一样的,但是spring boot不允许xml配置文件,所以可以写一个自定义的FreeMarker视图解析器. public class MvcConfig extends WebMvcConfigurerAdapter { @Bean public FreeMarkerViewResolv