• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why <c:set > tag is not used to set the values to List and Arrays(We can set for map and beans)

 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, with <c:set target=...>(target version) we can set values to map and beans. Why it is not possible to set with list objects and array objects?
Thankyou.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65342
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because the semantics make no sense or are difficult to define. Beans and maps associate a value with a property name. Lists and arrays do not. And it hardly makes sense to set things into a collection by index. What does it mean to set a value into the 213rd index of a 100-element array?

In all my years of writing web apps, this is not a need I have ever had and apparently the framers of the JSTL saw no need for it either.
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou, Sir.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65342
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome. Could it have been done? Sure.

But apparently the need for it was not seen, or at least not worth the effort of laboriously defining its semantics.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic