Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to remove session attribute

 
Aivis Vidins
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have two jsp files... (lets say A.jsp and B.jsp)

A contains a form and when it's submited it goes through B to process the data and then is redirected back to A. I'm able to add a session attribute on B, but for some odd reason I am not able to remove it anymore. I'm using the attribute to display a alert on A and once that's done I'd like to remove the attribute so that the alert doesn't pop up every time I open A after going through B. I tried removing the attribute on both A and B, but nothing seems to happen.

I'm using



content of A:


I can't really figure out what I am doing wrong and just nulling the attribute isn't an option. Any suggestions? Been sitting on this one for several days.. :(
 
harshvardhan ojha
Ranch Hand
Posts: 157
1
Android Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aivis, probably you want to say here



also, there is no problem with the code except

which should be
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. there is no HttpSession#addAttribute()

2. do not name a attribute like .. i.e,


you may get into trouble easily . for example
${sessionScope...} => will throw error. ofcourse you can use [] , as in ${sessionScope['..']} but that is different story ;)

3.
for me, it is not neat . why cant you check in JS as below?


4. session.getAttribute("typeEx") are you sure about name *typeEx* ?
 
Aivis Vidins
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, my bad. The attribute is named 'typeEx'.. the value is irrelevant (but I'm using 'true') in this case. Checking the attribute in JS didn't work for me.

so it's..


[edit] Can someone close this? The problem has been resolved. :)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic