1

I am placing some issues in alignment of JSPs . I have a parent JSP that needs to iterate over a set of features and place them side by side with a "|" in between. The parent JSP I have written contains this

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="horizonte-amazon-tags" prefix="hza"%>
<%@ taglib uri="aui" prefix="a"%>

<c:forEach var="feature" items="${view.subfeatureMap['featureList'].subfeatures}">
    <c:set var="featureName" value="${feature.featureName}" />
    <c:choose>
            <c:when test="${featureName eq 'first'}">
                    <jsp:include page="../first/common.jsp" />
            </c:when>
            <c:when test="${featureName eq 'second'}">
                    <jsp:include page="../second/common.jsp" />
            </c:when>
    </c:choose>
</c:forEach>

Now the first and second feature should come side by side with a separator "|" in between. I tried enclosing the two in separate divs like this using float.

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="horizonte-amazon-tags" prefix="hza"%>
<%@ taglib uri="aui" prefix="a"%>

<c:forEach var="feature" items="${view.subfeatureMap['featureList'].subfeatures}">
    <c:set var="featureName" value="${feature.featureName}" />
    <c:choose>
            <div style="float:left">
            <c:when test="${featureName eq 'first'}">
                    <jsp:include page="../first/common.jsp" />
            </c:when>
            <div>
            <span class="byLinePipe">|</span>
            <div>
            <c:when test="${featureName eq 'second'}">
                    <jsp:include page="../second/common.jsp" />
            </c:when>
            <div>
    </c:choose>
</c:forEach>

But this did not produce the output I want. This is placing the first and second feature one after the other Can someone point out where I am going wrong.

user2890683
  • 403
  • 2
  • 6
  • 18

0 Answers0