• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what should i use in jsp for displaying multiple records?

 
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic