【问题标题】:Where is 'param' variable defined in Spring MVC/Apache Tiles applicationSpring MVC/Apache Tiles 应用程序中定义的“param”变量在哪里
【发布时间】:2013-03-05 19:59:17
【问题描述】:

带有 Apache Tiles 应用程序的默认启动 Spring MVC 具有预定义的 tagx 文件列表。我发现一个变量 ${param} 到处都在使用,但找不到它定义和启动的地方,请任何人都可以提示它来自哪里?谢谢

例如,来自language.tagx:

<jsp:directive.attribute name="locale" type="java.lang.String" required="true" rtexprvalue="true" description="The locale for the language to be added." />
<jsp:directive.attribute name="label" type="java.lang.String" required="true" rtexprvalue="true" description="The country label for the language to be added." />
<jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" />

<c:if test="${empty render or render}">
<spring:url var="img" value="/images/${locale}.png" />
<spring:url var="url" value="">
  <c:if test="${null ne param.form}">
    <spring:param name="form" value="1" />
  </c:if>
  <c:if test="${not empty param.find}">
    <spring:param name="find" value="${param.find}" />
  </c:if>
  <spring:param name="lang" value="${locale}" />
  <c:if test="${not empty param.page}">
    <spring:param name="page" value="${param.page}" />
  </c:if>
  <c:if test="${not empty param.size}">
    <spring:param name="size" value="${param.size}" />
  </c:if>
</spring:url>
<spring:message code="global_language_switch" arguments="${label}" var="lang_label" htmlEscape="false" />
<a href="${url}" title="${fn:escapeXml(lang_label)}">
  <img class="flag" src="${fn:escapeXml(img)}" alt="${fn:escapeXml(lang_label)}" />
</a>
<c:out value=" " />
</c:if>

【问题讨论】:

  • 例子在哪里?
  • @AlanFoster 更新帖子。谢谢。

标签: java spring spring-mvc tiles apache-tiles


【解决方案1】:

paramUnified Expression Language 提供的隐式对象。它允许您访问请求参数的值。

【讨论】:

  • 谢谢。那么我们能否确认${param}主要用于传递之前请求的变量,最好不要填写自定义数据?
猜你喜欢
  • 2011-07-06
  • 2015-02-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-12-24
  • 2013-10-23
  • 1970-01-01
相关资源
最近更新 更多