• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on using <c:set > within <c:forEach>

 
Meera Pallath
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a sessionScope List named Employees. I am setting the value of field "related "as shown below. Within the loop
when I alert the value of "related", I get the correct value "1" back. But outside the loop the value is still "0" which is the default value.
So basically whatever value I am setting is not reflected. What am I doing wrong?

I need to to retrieve the value of "related" from a different page. When I retrieve the Employees list from sessionScope in a different page, for this particular employee
the value I am getting is "0"

Please help !

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the button on your post.

 
Meera Pallath
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the button on your post.



Sorry about that. I updated the post as suggested
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the purpose of using the code tags is that the natural indentation of your code can be seen. Is that really the way you indent your code?
 
Meera Pallath
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Well, the purpose of using the code tags is that the natural indentation of your code can be seen. Is that really the way you indent your code?


I tried to edit and correct the indentation. It is not coming out quite as I intended to.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Avoid tabs.
 
Meera Pallath
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Avoid tabs.

OK ...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fixed up the formatting a bit, but with the tabs it's difficult. You should replace them with all spaces.
 
Meera Pallath
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:I fixed up the formatting a bit, but with the tabs it's difficult. You should replace them with all spaces.


OK...Removed the tabs.
 
Meera Pallath
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic