How do I Include Static Files within a JSP Page

Static resources should always be included using the JSP include directive. This way, the inclusion is performed just once during the translation phase. Do note that you should always supply a relative URL for the file attribute. Although you can also include static resources using the action, this is not advisable as the inclusion is … Read more

What are Stored Procedures? How is it Useful

A stored procedure is a set of statements/commands which reside in the database. The stored procedure is pre-compiled and saves the database the effort of parsing and compiling sql statements every time a query is run. Each database has its own stored procedure language, usually a variant of C with a SQL preproceesor. Newer versions … Read more

In the Servlet 2.4 Specification SingleThreadModel has been Deprecated, why

Because it is not practical to have such model. Whether you set isThreadSafe to true or false, you should take care of concurrent client requests to the JSP page by synchronizing access to any shared objects defined at the page level. In the Servlet 2.4 specification, the SingleThreadModel interface was deprecated due to several reasons, … Read more

How Many JSP Scripting Elements are there and what are they

There are three scripting language elements: declarations, scriptlets, expressions. In advanced Java, specifically in JavaServer Pages (JSP), there are three types of scripting elements: Declarations: Declarations are used to declare variables or methods that can be used later in the JSP file. They are defined using the <%! %> syntax.Example: jsp <%! int myVariable = … Read more

How to Retrieve Warnings

SQLWarning objects are a subclass of SQLException that deal with database access warnings. Warnings do not stop the execution of an application, as exceptions do; they simply alert the user that something did not happen as planned. A warning can be reported on a Connection object, a Statement object (including PreparedStatement and CallableStatement objects), or … Read more