如何在面包屑中将http:// localhost:8080更改为home?

时间:2013-01-31 07:33:51

标签: jsp spring-mvc breadcrumbs

我在jsp

中使用它作为痕迹
<div class="breadcrumb">
       <c:url var="home"   value="http://localhost:8080/" />
        <c:forEach var="bc" items="${breadcrumb.tree}" varStatus="status">
            <c:choose>
                <c:when test="${status.index==0}">
                    <a href="/">${home}</a>
                </c:when>
                <c:when test="${status.index == fn:length(breadcrumb.tree)-1 && status.index!=0}">
                    »${bc.name}
                </c:when>
                <c:otherwise>
                    <a href="${bc.value}">»${bc.name}</a>
                </c:otherwise>
            </c:choose>
        </c:forEach>
</div>

我得到了这个 - http://localhost:8080/ »products

但我想要家»产品

任何人都可以告诉我它会是怎样的。

1 个答案:

答案 0 :(得分:0)

您存储的值为:

http://localhost:8080/

进入变量home,然后在锚标记中输出。

商店:

<c:url var="home"   value="http://localhost:8080/" />

输出:

<a href="/">${home}</a>

在消息文件中定义home,或忽略分配它。

相关问题