Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Iterate to give html row instead of table

Thread view: 
Tasperian Jigs - 10 Jan 2006 14:31 GMT
My legacy code has a class that has a method returning an html table.
I would like to create a method that returns rows to give me more
flexability. One row each time I invoke the method. Should I implement an
Iterator interface or something similar? I don't know which 'design
pattern' to follow. Any tips to the right direction would help.

Thanks in advance.

J
Andrea Desole - 10 Jan 2006 16:08 GMT
> My legacy code has a class that has a method returning an html table.
> I would like to create a method that returns rows to give me more
[quoted text clipped - 5 lines]
>
> J

Your description is not really clear. Assuming that you want to iterate
over a collection of objects in a web application, you should check out
the forEach tag in JSTL
Oliver Wong - 10 Jan 2006 16:22 GMT
> My legacy code has a class that has a method returning an html table.
> I would like to create a method that returns rows to give me more
> flexability. One row each time I invoke the method. Should I implement an
> Iterator interface or something similar? I don't know which 'design
> pattern' to follow. Any tips to the right direction would help.

   My undestanding is that your method previously returned a string which
contained the HTML representation of a table, and you now wish to return
several strings, each of which is a row in the table. With the information
you've given so far, iterator sounds like a decent fit, though it means you
may have to do something special to get the opening and closing "<table>",
"</table>" tags, since those aren't actually rows. Another possibility is to
just return a list of strings.

   - Oliver


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.