Thursday, December 24, 2009

Initializer block

The various initializer blocks are

Static Variables Initializer:
static blocks (a class can have any number of static blocks and they are executed in the particular order)
private static method(call this private static method for a private static variable)

Member variable Initializer:
Constructor
Initializer blocks (they are similar to static blocks without the word static)
private final method (call this private final method for a private variable)

Reference: http://java.sun.com/docs/books/tutorial/java/javaOO/initial.html

Sunday, August 16, 2009

Compress Response using gzip

Orion Link http://www.orionserver.com/tutorials/filters/5.html

Compression of the response can be done using filters. gzip utilities are available in java.util.zip package.

Saturday, August 08, 2009

Annotations - @

http://java.sun.com/docs/books/tutorial/java/javaOO/annotations.html

http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html

Hibernate Vs. CMP Entity beans

1) CMP requires one to one mapping between class and database table
2) No inheritence support
3) Relatively slow
4) Somone has to determine which field maps to which column
5) Requires app server
6) Requires special method names
7) Cannot be serializable

Hibernate - Google book

Click here
http://books.google.com/books?id=0d12xElRjysC&printsec=frontcover&source=gbs_navlinks_s#v=onepage&q=&f=false

Sunday, August 03, 2008

URI, URL and URN

Uniform Resource Identifier—A URI is a string that identifies any resource.
Identifying the resource may not necessarily mean that we can retrieve it. URI is
a superset of URL and URN.
• Uniform Resource Locator—URIs that specify common Internet protocols such
as HTTP, FTP, and mailto are also called URLs. URL is an informal term and is
not used in technical specifications.
• Uniform Resource Name—A URN is an identifier that uniquely identifies a
resource but does not specify how to access the resource. URNs are standardized
by official institutions to maintain the uniqueness of a resource.


Here are some examples:
• files/sales/report.html is a URI, because it identifies some resource.
However, it is not a URL because it does not specify how to retrieve the resource.
It is not a URN either, because it does not identify the resource uniquely.
• http://www.manning.com/files/sales/report.html is a URL because
it also specifies how to retrieve the resource.
• ISBN:1-930110-59-6 is a URN because it uniquely identifies this book,
but it is not a URL because it does not indicate how to retrieve the book.

Saturday, August 02, 2008

Tomcat Servlet Container and Apache webserver

The main web server and the servlet container are different
programs, but the container runs within the address space of the main server as
a plug-in.

An example of this type is Tomcat running inside Apache Web Server. Apache
loads a JVM that runs Tomcat. In this case, the web server handles the static
content by itself, and Tomcat handles the servlets and JSP pages.