我有 Spring 控制器,在其中我将一些属性映射到模型,然后通过 jsp 页面显示模型信息......问题是所有属性(即${attributeName}
- 这是我在渲染页面中得到的)都按定义显示,没有值。到目前为止,这工作得很好。我怀疑其中一个库丢失了,但不知道是哪个库...
提前致谢。
控制器示例
@RequestMapping(value="/entity", method=RequestMethod.GET)
public String getEntity(@RequestParam (value="q", required=true) String q, Model model){
model.addAttribute("q", q);
return "viewName"; //this is jsp file name
}
视图名称.jsp
${q}
当我调用 localhost:8080/controller/entity?q=string 时,输出应该是“string”,但输出是 ${q}