我想要两个约会.1)MM/dd/yy格式的当前日期2)修改日期,即5个工作日(周一至周五)至当前日期的加法,应为MMM dd,yyyy格式.
因此,如果我的当前时间是6月9日,那么currentDate应该是06/09/14,并且modifiedDate应该是2014年6月13日.
这该怎么做?
我的 spring 应用程序中有这样的静态资源结构:
\src
\main
\webapp
\resouces
\css\..
\js\..
Run Code Online (Sandbox Code Playgroud)
并像这样配置了 VersionResourceResolver :
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/resources/**").addResourceLocations("/resources/")
.setCacheControl(CacheControl.maxAge(365, TimeUnit.DAYS)).resourceChain(true)
.addResolver(new VersionResourceResolver().addContentVersionStrategy("/**"));
}
Run Code Online (Sandbox Code Playgroud)
我在我的 jsp 中使用 jstl 包含了资源:
<script type="text/javascript" src="<c:url value="/resources/js/my.js"/>"></script>
Run Code Online (Sandbox Code Playgroud)
但是当我运行应用程序时,我看不到任何类型的版本控制。我错过了什么?
我也试过:
但没有运气
更新
我包括这样的资源:
<link rel="stylesheet" href="<c:url value="/resources/css/mycss.css?v=2" />">
<script type="text/javascript" src="<c:url value="/resources/js/myjs.js?v=1"/>"></script>
Run Code Online (Sandbox Code Playgroud)
这就是正在生成的内容:
<link rel="stylesheet" href="/app/resources/css/mycss.css?v=2">
<script type="text/javascript" src="/app/resources/js/myjs.js?v=1"></script>
Run Code Online (Sandbox Code Playgroud)
索引页使用:
<welcome-file-list>
<welcome-file>/WEB-INF/views/index.jsp</welcome-file>
</welcome-file-list>
Run Code Online (Sandbox Code Playgroud)
控制器:用于家庭等...
@RequestMapping(value = "/home", method = RequestMethod.GET)
public ModelAndView home(HttpServletRequest request, ModelMap model) {
...
}
Run Code Online (Sandbox Code Playgroud)