首页 文章

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

提问于
浏览
0

我在jsp中使用它作为breadcrumb

<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

    您存储的值为:

    http://localhost:8080/
    

    进入变量home,然后在anchor标记内输出 .

    商店:

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

    输出:

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

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

相关问题