0

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)}" title="${fn:escapeXml(home_label)}">
  <img src="${banner}" />
</a>

Where are variables home, home_label, banner defined?

1 Answer 1

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.