Submitted by heartin on Fri, 09/25/2015 - 06:55
Submitted by heartin on Fri, 09/18/2015 - 14:06
JSPs are actually servlets. Container will convert all jsp files as servlets before executing it. By default, the JSP is compiled into a servlet and then loaded the first time it is accessed. This might cause a small delay for the first request, but there won’t be any delay in subsequent requests. You may also precompile JSPs before adding them into JARs. Certain application servers might even provide tools for doing so.
Submitted by heartin on Fri, 09/18/2015 - 12:04
While servlets can be considered Java classes that contain some html code, JSPs can be considered as html pages (except for the .jsp extension and some extra lines) with some java inside.
If we use servlets, we should use a print statement for sending every line of the html code to the client.
Example
JSP File
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
Submitted by heartin on Mon, 09/14/2015 - 22:15
Casting is the conversion of data of one type to another type either implicitly or explicitly.
Casting happens for both primitive types and reference types.
If the casting operation is safe, java will do automatic type casting. This is called implicit type casting.
If java can't be sure whether the casting will be safe, java will not do automatic casting, but programmer can do the casting if he is sure about the outcome. This is called explicit type casting.
Submitted by heartin on Mon, 09/14/2015 - 22:02
Encapsulation is the process of wrapping up of data (properties) and behavior (methods) of an object into a single unit; and the unit here is a Class (or interface). Encapsulate in plain English means to enclose or be enclosed in or as if in a capsule. In Java, everything is enclosed within a class or interface, unlike languages such as C and C++ where we can have global variables outside classes.
Pages