This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL c:remove does not seem to work

 
Gayatri Ganesh
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to remove an attribute in my jsp which was set in my action.

I say in Action :
request.getSession().setAttribute("myattribute", "y");

In my jsp :
<c:remove var="myattribute" />

I tried :
<c:remove var="myattribute" scope="session"/>
<c:remove var="{sessionScope.myattribute}" />

But none seem to work.

Can anyone please advice.

Thanks,
Gayatri
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the tag being invoked or is it merely being piped to the response? Also, <c:remove var="{sessionScope.myattribute}" /> should be <c:remove var="${sessionScope.myattribute}" />

Granted, I've never actually used this action, but those are my first guesses.
 
Gayatri Ganesh
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying.

This worked for :
<c:remove var="myattribute" scope="session"/>

Thanks,
Gayatri
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic