This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Struts and the fly likes what should i use in jsp for displaying multiple records? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "what should i use in jsp for displaying multiple records?" Watch "what should i use in jsp for displaying multiple records?" New topic
Author

what should i use in jsp for displaying multiple records?

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
previously i use to go for while loop and for loop inside the jsp page for displaying certain number of records

but now comming to struts frame work there is a restriction that we should not use java code(scriptlet) inside the jsp page


but how can i display some set of records ?


I am new to struts frame work

and one more question can i call action calls as servlet?
thanks in advance


A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
RoshaniG Gopal
Ranch Hand

Joined: May 15, 2006
Posts: 180
Originally posted by saikrishna cinux:
but now comming to struts frame work there is a restriction that we should not use java code(scriptlet) inside the jsp page


Hi,
You may use logic resent in conjunction with logic:iterate to iterate and bean:write to write the records that are fetched on the jsp.
Best practices and industry stds say that use of scriplets should not be done(though they work). you may also use JSTL for that (use foreach, etc for your records
regards,
Roshani


Regards,<br />Roshani
Chris Boldon
Ranch Hand

Joined: Aug 10, 2006
Posts: 190
Example:



The logic empty first checks to see if there is any information to iterate over, if there isnt it displays "No books available". If there is information present it will use the logic iterate to print out author and title, all an element of book.

Hope this example was of some help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what should i use in jsp for displaying multiple records?