Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Resetting an objects variable with JSTL and EL

 
Sverre Moe
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using JSP 2.0 and JSTL 1.1.2

I have an object defined within ${sessionScope.sessionData}
This sessionData object has a getter and setter for a variable of another object. While I can access the getter like this ${sessionScope.sessionData.myVar} I am not sure how to set/reset it

I have tried both
${sessionScope.sessionData.var["null"]} and
<c:set target="${sessionScope.sessionData}" property="var" value="null"/>

Both does not give any error, but I am not sure if it is working. The method setVar takes in an object of lets say Object1, and by changing the value null to any random value it does not give any error. I would assume that by trying to set a variable other than the desired object or null would produce an error.

Am I really setting the variable in any of the above examples?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65340
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not just add some logging to see whether your setter is being called or not, and with what value?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic