File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what should i use in jsp for displaying multiple records?

 
saikrishna cinux
Ranch Hand
Posts: 689
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
RoshaniG Gopal
Ranch Hand
Posts: 180
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Chris Boldon
Ranch Hand
Posts: 190
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic