开发者

Spring roo project, header binding

I'm new to spring mvc and spring projects.

I've created new spring roo project. I the header.jspx I've noticed use of binding

<a href="${home}" name="${fn:escapeXml(home_label)}" ti开发者_如何学JAVAtle="${fn:escapeXml(home_label)}">
  <img src="${banner}" />
</a>

Where are variables home, home_label, banner defined?


Look a few lines above:

<spring:url var="banner" value="/resources/images/banner-graphic.png" />
<spring:url var="home" value="/" />
<spring:message code="button_home" var="home_label" />
<a href="${home}" name="${fn:escapeXml(home_label)}" title="${fn:escapeXml(home_label)}">
    <img src="${banner}" />
</a>

These variables are results of <spring:url> and <spring:message> tags exported as variables. Using attriubte named var to specify variable names is a common pattern for such cases.

<spring:url> prepends the given path with application's context path if necessary in order to produce absolute path. <spring:message> exrtacts a message with a given key from .properties files used for localization.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜