Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Usage of JSTL SQL tags

 
Prasad Babu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am using JSTL SQL tags for populating some form elements in my JSP. It is noted that it should not be used SQL tags for performance or some thing else. I found that its very easy way to populating the elements. My doubt is why dont I have to use SQL tags. Please anybody clearify my doubt.
thanks in advance
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because it is bad form to put database (DB) access code in a JSP.

Even with the JSTL tags, you lose the separation of concerns that you would get if you put your db code in Javabeans.
Moving all of this code to beans will allow you to add a main method and run all of your initial tests right from the command line. You can later call these methods from unit/integration testing scripts for regression testing.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64683
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even the JSTL Specification itself warns against using these tags for production code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic