Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Call method when jsp first loaded  RSS feed

 
Cloey Tan
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How to invoke a method to populate some data to an arraylist before the jsp page gets loaded so that certain data can be showned on the jsp page? And how to populate content of an arraylist to jsp page without having to use logic iterate tag? Please help and thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65828
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is precisely the job of the page controller.

And on-page, you'd use the <c:forEach> JSTL tag to iterate over the list.

If the concept of a "page controller" is foreign to you, you might benefit from this article.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To the point: map a servlet on the desired URL and implement doGet() to do the task.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!