wood burning stoves 2.0*
The moose likes JSP and the fly likes Usage of JSTL SQL tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Usage of JSTL SQL tags" Watch "Usage of JSTL SQL tags" New topic
Author

Usage of JSTL SQL tags

Prasad Babu
Ranch Hand

Joined: Jul 17, 2005
Posts: 57
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

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60804
    
  65

Even the JSTL Specification itself warns against using these tags for production code.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: Usage of JSTL SQL tags
 
Similar Threads
JSTL sql:query doubt
Doubt
Doubt in the HFSJ 9 chapter
Doubt
urgent...select ....option... doubt