• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which is Best Way to Get a List for JSP

 
Steve Dyke
Ranch Hand
Posts: 1616
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to get a list of users for a JSP select list. The list is hidden unless a user clicks a button.

My question is this. Which is the better metdod?

I can either get the list in my servlet response and set this string to a session attribute then use JSTL to populate the select list.

Or

Run jQuery when button is clicked and populate select list with return string.
 
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
Unless the content of the list is dependent upon data that can't be known until after the page has been sent to the client, I'd render the list as part of the JSP before shipping it off to the client.

Why add all the extra moving parts if you don't have to?
[ July 15, 2008: Message edited by: Bear Bibeault ]
 
Steve Dyke
Ranch Hand
Posts: 1616
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic