You can add the flag to request after the if block -
request.setAttribute("flag", flag);
And later use the <c:choose>
for conditional display -
<c:choose>
<c:when test="${requestScope.flag == 1}">
<!-- flag is 1 -->
</c:when>
<c:otherwise>
<!-- flag isn't 1 -->
</c:otherwise>
</c:choose>
Note: Scriplets in JSP is a bad practice. I strongly recommend that you read this answer.