Web programming

Units WEB1P and WEB2P

JSTL SQL library

There is a "quick" way to produce database reports using JSP and the Java Standard Tag Library (JSTL).

JSTL contains an SQL tag library. These tags can be used to generate JDBC actions on a database. They are mostly used for reporting (by doing a SELECT), but in principle can be used to do database modifications as well.

This method can be used when:

This method should be avoided when:
  • the content of the web page consists virtually entirely of data from a query
  • the database needs to be updated (use a business data access object from a servlet instead)
  • all (or nearly all) JSPs are called from servlets (e.g. when using Struts)
  • access to the report is managed by application-level security
  • you are trying hard to stick to the MVC pattern
  • the web application is using Hibernate or any other package that involves data caching

References:

 

Last updated by Prof Jim Briggs of the School of Computing at the University of Portsmouth

 
The web programming units include some material that was formerly part of the WPRMP, WECPP, WPSSM and WEMAM units.