开始写Blog
折腾了一个晚上去找各种Blog,都没有我想要的,尤其是代码格式化的美观问题。哎算了
1 @RequestMapping("/show.htm") 2 public ModelAndView show(HttpServletRequest request){ 3 String baseURL = request.getScheme()+"://"+request.getServerName(); 4 int port = request.getLocalPort(); 5 if (port != 80 || port != 443) { 6 baseURL = baseURL + ":" + port; 7 } 8 return new ModelAndView("dlog","baseURL",baseURL); 9 }
贴段代码看看