Skip to content
This repository was archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
增加absPath
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou-hao committed Feb 15, 2017
1 parent 730ebd7 commit 830124c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public Resource getResource(String location) {
return configurer;
}

@Bean
public WebMvcConfigurerAdapter webMvcConfigurerAdapter() {
return new WebMvcConfigurerAdapter() {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("classpath*:/static");
super.addResourceHandlers(registry);
}
};
}
// @Bean
// public WebMvcConfigurerAdapter webMvcConfigurerAdapter() {
// return new WebMvcConfigurerAdapter() {
// @Override
// public void addResourceHandlers(ResourceHandlerRegistry registry) {
// registry.addResourceHandler("classpath*:/static");
// super.addResourceHandlers(registry);
// }
// };
// }
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.hsweb.platform.ui.controller;

import org.hsweb.web.core.authorize.annotation.Authorize;
import org.hsweb.web.core.utils.WebUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
Expand All @@ -19,8 +20,9 @@ public class DynFomViewController {
public ModelAndView save(@PathVariable("name") String name,
@RequestParam(value = "id", required = false) String id) throws Exception {
ModelAndView modelAndView = new ModelAndView("admin/dyn-form/save");
modelAndView.addObject("name",name);
modelAndView.addObject("name", name);
modelAndView.addObject("id", id);
modelAndView.addObject("absPath", WebUtil.getBasePath(WebUtil.getHttpServletRequest()));
return modelAndView;
}

Expand All @@ -29,8 +31,9 @@ public ModelAndView save(@PathVariable("name") String name,
public ModelAndView info(@PathVariable("name") String name,
@RequestParam(value = "id", required = false) String id) throws Exception {
ModelAndView modelAndView = new ModelAndView("admin/dyn-form/info");
modelAndView.addObject("name",name);
modelAndView.addObject("name", name);
modelAndView.addObject("id", id);
modelAndView.addObject("absPath", WebUtil.getBasePath(WebUtil.getHttpServletRequest()));
return modelAndView;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public ModelAndView listPage(@PathVariable("key") String key, String metaId) thr
ModelAndView modelAndView = new ModelAndView("admin/module-view/list-fast");
modelAndView.addObject("key", key);
modelAndView.addObject("metaId", metaId);
modelAndView.addObject("absPath", WebUtil.getBasePath(WebUtil.getHttpServletRequest()));
return modelAndView;
}

Expand All @@ -63,6 +64,7 @@ public ModelAndView savePage(@PathVariable("metaId") String metaId,
modelAndView.addObject("metaId", metaId);
modelAndView.addObject("version", version);
modelAndView.addObject("id", id);
modelAndView.addObject("absPath", WebUtil.getBasePath(WebUtil.getHttpServletRequest()));
return modelAndView;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public ModelAndView login(String uri) throws UnsupportedEncodingException {
ModelAndView modelAndView = new ModelAndView("admin/login");
if (uri != null)
modelAndView.addObject("uri", uri);
modelAndView.addObject("absPath", WebUtil.getBasePath(WebUtil.getHttpServletRequest()));
return modelAndView;
}

Expand All @@ -38,6 +39,7 @@ public ModelAndView view(HttpServletRequest request,
ModelAndView modelAndView = new ModelAndView(path);
modelAndView.addObject("param", param);
modelAndView.addObject("absPath", WebUtil.getBasePath(request));

return modelAndView;
}

Expand All @@ -49,9 +51,4 @@ public String getUri(HttpServletRequest request) {
}
return path;
}

public static void main(String[] args) {
System.out.println(new BigInteger(MD5.encode("aaaaaass"),16));
}

}

0 comments on commit 830124c

Please sign in to comment.