spring - Spring MVC 中 s:property 的等价物
问题描述
我目前正在将 Struts2 项目转换为 Spring MVC,并且我正在努力寻找与 Spring 中的 s:property 标记等效的内容。这是我要转换的一些示例:
<s:property value="#contentha.idcontent"/>
<s:property value="%{topRex.idcontent}"/>
谢谢你的帮助 !
解决方案
你可以写
${contentha.idcontent}
${topRew.idcontent}
如果你想使用一个标签,你可以写:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:out value="${contentha.idcontent}" />
<c:out value="${topRew.idcontent}" default="Value if null" />
这将需要jstl
依赖。例如,如果您使用 Maven:
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
推荐阅读
- django - 两个 Django ManyToMany 字段中的匹配数
- html - 如何创建响应式 H3 文本
- graph - How can I extract information from Arduino graph.Or from the Processing software connected with Arduino
- django - Fetch object that have existing many-2-many related objects in django
- local-storage - indexeddb (IDB) 索引不适用于年份字段
- javascript - Vue and CSS3: absolute position in a relative wrapper messes up height
- python - Regular expression to match "verb" but not the "verb" in "adverb"
- c# - Get SharePoint user detail via Azure Chat bot
- .net - .Net Core / Angular 6 - Access-Control-Allow-Origin 不允许来源
- javascript - 如何使用 ajax 和 mysql 遍历数据