• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Okay, but......

 
Carol Murphy
village idiot
Bartender
Posts: 1203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even if I put the individual data from videos into an ArrayList and pass it to the jsp as an attribute, printing it out to the table cells in the jsp would still require iterating through the ArrayList using scriplets and expressions, would it not? Except it seems that the data is now just a long list of Strings instead of members of VideoData, which might be less clear. Is there a way to put all of the logic for populating the cells of the table in the servlet class and call this method from the jsp?
 
Carol Murphy
village idiot
Bartender
Posts: 1203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, I've had a few beers. Here's a thought, powered by Coors; what if I created the entire table in the servlet class, and passed that as an attribute to the jsp? But then I remember reading somewhere that a bunch of html in java code was coyote ugly..........or was it the other way round?
 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems to me that a few <tr>'s and <td>'s in the servlet are better than scriplets in the jsp.
 
Carol Murphy
village idiot
Bartender
Posts: 1203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should the solution involve use of EL? I am struggling with trying to put all of the logic involved with iterating through the ArrayList and printing the data in the appropriate cell of the table into the servlet class. If I write a method that has out.print() stuff in it for printing the table data, I don't know how to call the method from the JSP, and if I don't write a method that prints out the data to the table in the servlet class, I can't see how to avoid doing a for loop in the jsp to iterate through the table data. Obviously, there's something I'm not seeing here.
 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Carol Murphy:
Should the solution involve use of EL?


No.

What if you iterate through the loop in the servlet and create a String which you then forward to the jsp.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[MdQ]: No.

No of course not Carol - don't be silly. That would be too modern. Think 20th century technology. What year do you think this is, 2006? :roll: After all, the system must be maintainable if you're caught in a time vortex and thrown back to 1996.
[ May 24, 2006: Message edited by: Jim Yingst ]
 
Carol Murphy
village idiot
Bartender
Posts: 1203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Marilyn de Queiroz:


What if you iterate through the loop in the servlet and create a String which you then forward to the jsp.


That String would be obscenely long, wouldn't it?
 
Carol Murphy
village idiot
Bartender
Posts: 1203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jim Yingst:
[MdQ]: No.

No of course not Carol - don't be silly. That would be too modern. Think 20th century technology. What year do you think this is, 2006? :roll: After all, the system must be maintainable if you're caught in a time vortex and thrown back to 1996.

[ May 24, 2006: Message edited by: Jim Yingst ]


Wait, it's not 1996? Then I'm sure I'm late for something!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic