• Post Reply Bookmark Topic Watch Topic
  • New Topic

Display datas on Jsp Page from the Database  RSS feed

 
Ram kanana
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To show the data on jsp page from the database(using business logic), i used javabean object for setting the fielde using set attribute and pass this object to the jsp page. In the JSP page i used get attribute for that object for retriew the data and showed in the jsp page.

database -> setfields -> pass object -> getfields -> show data

or

Fetching the data from the databse using String '+'(concatenation) operator and pass the string and then showed on the resultant JSP Page.

Which one is better?
 
Joshua Cloch
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first idea is somewhat more preferred in most cases, because it provides good capsulation of the business data. However, it the application is quite small, the second is also ok.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would rather disagree with the latter point. Small applications have ways of become bigger applications over time and poor choices at the beginning become huge headaches later. My advice is to always use good application patterns and structures.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!