My friend advised me that it is not a good practice to create a database connection using a JSP instaed of a servlet as it is availble outside WEB-INF package.
what is the real scenario behind this? what are the disadvantages in making a DB connection using JSP?
posted 9 years ago
A jsp is meant for presentation.
The normal practice is to have javabeans which are like special java classes with properties and getters and setters for these properties and have java classes which make the actual database calls to get and set the values for a java bean.
The normal practice is to instantiate your beans inside a servlet or jsp and put them in session as you need them.