Singleton pattern

The Singleton design pattern proposes   At any time there can only be one instance of a class  We should allow global point of access to that single instance. The class’s default constructor is made private, which prevents the direct instantiation of the object by others (Other Classes). A static modifier is applied to the ...

SheBANG(S)!!!!

  In computing, a shebang or Hashbang is the sequence of character sequence consisting of number sign followed by exclamation mark (#!), when it occurs as the first two characters on the first line of the textfile. In this case, the program loader in Unix-like operating systems parses the rest of the first line as an interpreter directive and invokes ...

Servlet’s Life…

Initializing… When the Web Container is started the container loads the servlet class and create the instance of  the servlet. The container calls the no-argument init() method (called only once) on the servlet instance after the servlet instance is created but before the servlet can service any request.   Servicing… 1. When a user clicks a ...

Servlet’s Life moment Listeners

Scenario  Listener interface  Event type  You want to know if an attribute in a web app context has been added, removed, or replaced. javax.servlet.ServletContextAttributeListener attributeAdded attributeRemoved attributeReplaced ServletContextAttributeEvent  You want to know how many concurrent users there are. In other words, you want to track the active sessions. (We cover sessions in detail in the ...

Scripting Language and Programming Language

Scripting languages (JavaScript, Python , bash etc.) are interpreted at run-time. The commands written in scripting languages are read  and executed line by line . A separate program is required to read the code,interpret it and then  follow the instructions in the code. An error is issued when a line cannot be executed for any reason.   ...

Schema and User in Oracle

A schema is the set of metadata (data dictionary) used by the database, typically generated using DDL(Data Definition Language). A schema defines attributes of the database, such as  tables, columns, and properties.   A database schema is a description of the data in a database.   Consider a schema to be the user account and collection of ...

RequestProcessor Class

RequestProcessor Class is the actual place where the request processing takes place in a Struts controller environmentStruts Documentation When the request object first reaches the actionservlet class ,it invokes the process method of the underlying  RequestProcessor Class.   This process method then looks into the struts-config.xml file and tries to locate the name of the action that has come with ...

RequestDispatcher

A RequestDispatcher object can forward a client’s request to a resource or include the resource itself in the response back to the client. A resource can be another servlet, or an HTML file, or a JSP file, etc. You can also think of a RequestDispatcher object as a wrapper for the resource located at a given path ...

Preinitialization of Servlet

 A container does not initialize the servlets as soon as it starts up, it initializes a servlet when it receives a request for that servlet first time. This is called lazy loading. The servlet specification defines the element, which can be specified in the deployment descriptor to make the servlet container load and initialize the ...

Overloading and Overriding

 S.No.    Overloaded Methods  Overridden Methods  1.  Arguments  Must Change  Must not change  2.  Return Type  Can change  Can’t change except for covariant returns  3.  Exceptions  Can change  Can reduce or eliminate. Must not throw new or broader checked exception  4.  Access Modifiers  Can change  Must not make more restrictive (can be less restrictive)  5. ...