JSP页面don';我认不出标签
谁能帮助我理解,我的jsp页面有什么问题吗。“foreach”循环正在工作,但项目的成员不显示(简单文本出现在其位置)JSP页面don';我认不出标签,jsp,spring-mvc,Jsp,Spring Mvc,谁能帮助我理解,我的jsp页面有什么问题吗。“foreach”循环正在工作,但项目的成员不显示(简单文本出现在其位置)
上次更新:$(item.TimeLastUpdate)
#注释:$(item.commentsCount)
$(item.text)
页面的控制器如下所示:
@RequestMapping(value = "/", method = RequestMethod.GET)
public ModelAndView home(Locale locale, Model model)
{
logger.info("Welcome home! the client locale is "+ locale.toString());
logger.info("Running SIMPLE_BLOG");
Date date = new Date();
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
String formattedDate = dateFormat.format(date);
model.addAttribute("serverTime", formattedDate );
Iterable<Topic> listTopic = service.findAllTopics();
return new ModelAndView("home", "model", listTopic);
}
@RequestMapping(value=“/”,method=RequestMethod.GET)
公共模型和视图主视图(区域设置、模型模型)
{
info(“欢迎回家!客户端语言环境是”+locale.toString());
logger.info(“运行简单的博客”);
日期=新日期();
DateFormat DateFormat=DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG,locale);
字符串formattedDate=dateFormat.format(日期);
model.addAttribute(“serverTime”,formattedDate);
Iterable listTopic=service.findAllTopics();
返回新模型和视图(“主页”、“模型”、列表主题);
}
使用
不是
语法为
${}
非$()您需要对括号中的所有表达式执行此操作,例如$(item.timeLastUpdated)应为${item.timeLastUpdated}
@RequestMapping(value = "/", method = RequestMethod.GET)
public ModelAndView home(Locale locale, Model model)
{
logger.info("Welcome home! the client locale is "+ locale.toString());
logger.info("Running SIMPLE_BLOG");
Date date = new Date();
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
String formattedDate = dateFormat.format(date);
model.addAttribute("serverTime", formattedDate );
Iterable<Topic> listTopic = service.findAllTopics();
return new ModelAndView("home", "model", listTopic);
}
${item.author}
$(item.author)