开发者

Some dynamic flexibility in JSP If Else and Sessions

开发者 https://www.devze.com 2023-04-11 04:20 出处:网络
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 le

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

精彩评论

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