主题 : 请问${channel} |
级别: 商业授权用户
|
1# 发表于:2014-02-28 08:28:39 IP:60.216.*.*
|
||||
---|---|---|---|---|---|
级别: 状元
|
2# 发表于:2014-02-28 08:39:56 IP:182.205.*.*
什么页面有页面可以访问${channel]?${channel.name]才有吧?
|
||
---|---|---|---|
级别: 商业授权用户
|
3# 发表于:2014-02-28 08:53:05 IP:60.216.*.*
${channel]?${channel.name]
都一样1个是对象的ToString形式 1个是对象的名字 关键这个对象在什么时候放到FreeMarke数值模型中的? FrontUtils.frontData(request, model, site);--根本没有channel对象 啊 |
||
---|---|---|---|
级别: 商业授权用户
|
5# 发表于:2014-02-28 09:12:15 IP:60.216.*.*
public static void frontData(Map<String, Object> map, CmsSite site,
CmsUser user, String location, Long startTime) { if (startTime != null) { map.put(START_TIME, startTime); } if (user != null) { map.put(USER, user); } map.put(SITE, site); String ctx = site.getContextPath() == null ? "" : site.getContextPath(); map.put(BASE, ctx); map.put(RES_SYS, ctx + RES_PATH); String res = ctx + RES_PATH + "/" + site.getPath() + "/" + site.getTplSolution(); // res路径需要去除第一个字符'/' map.put(RES_TPL, res.substring(1)); map.put(LOCATION, location); } |
||
---|---|---|---|
级别: 状元
|
9# 发表于:2014-02-28 09:19:46 IP:182.205.*.*
* 动态页入口
*/ @RequestMapping(value = "/**/*.*", method = RequestMethod.GET) public String dynamic(HttpServletRequest request, HttpServletResponse response, ModelMap model) { // 尽量不要携带太多参数,多使用标签获取数据。 // 目前已知的需要携带翻页信息。 // 获得页号和翻页信息吧。 int pageNo = URLHelper.getPageNo(request); String[] params = URLHelper.getParams(request); PageInfo info = URLHelper.getPageInfo(request); String[] paths = URLHelper.getPaths(request); int len = paths.length; if (len == 1) { // 单页 return channel(paths[0], pageNo, params, info, request, response, model); } else if (len == 2) { if (paths[1].equals(INDEX)) { // 栏目页 return channel(paths[0], pageNo, params, info, request, response, model); } else { // 内容页 try { Integer id = Integer.parseInt(paths[1]); return content(id, pageNo, params, info, request, response, model); } catch (NumberFormatException e) { log.debug("Content id must String: {}", paths[1]); return FrontUtils.pageNotFound(request, response, model); } } } else { log.debug("Illegal path length: {}, paths: {}", len, paths); return FrontUtils.pageNotFound(request, response, model); } } |
||
---|---|---|---|