Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Session attribute problem!  RSS feed

 
Martin Asenov
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all!

I experienced a problem and was unable to solve it for an hour, so I guess (and hope) you could give me some solution.

I have a JSP page, called Dispatcher.jsp.
It contains the following code:



And in Resolver.jsp through a tag handler I get the request.getParameter("query") and set it to the session as an attribute, because I need it in perspective. And everything works fine.

But when it comes to getting back on page Dispatcher.jsp and giving through the request the parameter to the same tag handler in Resolver.jsp, it obviously does not set it to the session, because the old attribute remains untouched. In result i still get the same output, no matter that I've 'changed' the session attribute and the same old "if" gets executed in the tag handler. So if I'd worked with 'view device' and after that i select 'edit device' I don't get the desired result.

Do attributes override when I say twice with another value for the field 'query'?:


P.S. I tried to use remove attribute before re-setting it, but i got side effects, that don't make sense.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, setting new values for scoped variables of the same name will override the old values.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!