문제

I have been googling and found that I can remove a session attribute using:

<c:remove var="foo" />

What I want is to clear all session attributes from a JSP, something like this:

<c:forEach  var="item" items="${sessionScope}">
    <c:remove var="${item }" scope="session"/>
</c:forEach>    

The problem is that the code from above gives me this warning

c:remove doesn't support runtime expression

And I can't view the JSP where I put the code.

Is it possible? Is it a good practice to do something like this?

도움이 되었습니까?

해결책

Because your are iterating through "item" and while iterating it inside loop you are trying to delete.

Better do this logic in java only rather than JSP

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top