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

cset problem

 
Chaminda Amarasinghe
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I wrote simple code to test the <c:test>

here is the full code

Employee.java



ServletClass.java



jsp




I think there is no
empA
attribute in the session (because we set it to request). So [B]c:set[B] creates new object.

the created object has not property called name or id,

so there should be no out put.

but the out put was

Name: Chaminda
Id: 1

can some body explain this?

Regards,
Chminda
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

<c:set var="empB" scope="session" value="${empA}" />

I think there is no empA attribute in the session (because we set it to request). So [B]c:set[B] creates new object.


THe scope in <c:set> is about the variable being set (var="empB") and not about the value (value="${empA}").
 
Chaminda Amarasinghe
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic