开发者

Some dynamic flexibility in JSP If Else and Sessions

I'm a little mixed up on syntax with quotes (' vs. ") and all.

I would really love to be able to开发者_StackOverflow社区 test for a session attribute after another page set it. I don't want to learn anything too new like javascript yet, but definitely will set aside time for Javascript ASAP.

How can I display a request attribute or session attribute if it was already set?

<c:choose>
<c:when test="${request.getAttribute('currSubTopic')!=null}">
(<c:out value="${request.getAttribute('pLCurrent')}"/>, <c:out value="${request.getAttribute('pFCurrent')}"/> )
</c:when>
<c:when test="${null!=session.getAttribute('pFCurrent')}">
(<c:out value="${session.getAttribute('pLCurrent')}"/>, <c:out value="${session.getAttribute('pFCurrent')}"/> )
</c:when>
</c:choose>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜