Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom tags  RSS feed

 
Srividya Shiv
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using JSP Model2 architecture. I have a table in the database which I have mapped exactly to a JavaBean. Depending on the number of rows in the table I want to iterate that many times to set attribute to the bean and display them thru JSP. I do not want to do any looping in my JSP page(avoid scriplet). Can I do it using custom tags?
Can somebody help?
Thanks
srividya
PS: Hope I have made myself clear.
 
Anoop Krishnan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai Srividya ,
I hope you know to implement custom tags.So just pass your ResultSet as an attribute to the custom tag and iterate inside the tag implementation
 
Sarath Mohan
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srividya,
You can easily implement this requirement using the custom tags.
For that you should be familiar with custom tag implementation in JSP. You can see an example in Ch 14/the Java Server Pages by Larn Pekowsky (Addision Wesley)
Thanks
Binu
 
Sarath Mohan
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srividya,
You can easily implement this requirement using the custom tags.
For that you should be familiar with custom tag implementation in JSP. You can see an example in Ch 14/the Java Server Pages by Larn Pekowsky (Addision Wesley)
Thanks
Binu
 
Srividya Shiv
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies
I browsed the Struts package from apache and found that they have a custom tag for almost all html tags plus also for iterations etc. It practiaclly eliminates java code from JSP. But what about performance with teh overhead of creating so many beans? Can someone tell me if this recommended?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!