What happens when you type a web page address in the address bar

Your browser, if it doesn’t already know, will ask your OS’s DNS system what the address (IP address) of the host (“www.google.com,” for example) is. If your OS doesn’t know, it will query third-party DNS servers (those of your ISP, for example). Once an address is obtained, your web browser establishes a TCP/IP socket connection,…

Write a program to create a outOfMemoryException

OutOfMemoryError is thrown when the JVM can’t allocate enough memory to complete the requested action. To produce these just allocate a bunch of memory in a loop or something similar, but remember to keep your already allocated objects, preferably in a ArrayList or something, or else the garbage collector might reuse the space and free…

Stack and Heap

The stack is the memory set aside as scratch space for a thread of execution. When a function is called, a block is reserved on the top of the stack for local variables and some bookkeeping data. When that function returns, the block becomes unused and can be used the next time a function is…

enable / disable a JSF Command Button

primeface page goes like this,  <p:commandButton update=”panel1″  actionListener=”#{bean.button1}” value=”button1″ disabled=”#{bean.disable}”>      <f:setPropertyActionListener value=”#{false}” target=”#{bean.disable}”/>    </p:commandButton>  <p:commandButton update=”panel2″  actionListener=”#{bean.button2}” value=”button1″ disabled=”#{!(bean.disable)}”>      <f:setPropertyActionListener value=”#{true}” target=”#{bean.disable}”/>      </p:commandButton> Manage Bean:  public class Bean {     private boolean disable;     // default constructor     public Bean(){        this.disable= false;…

Spring Bean Scopes

When defining a <bean> in Spring, you have the option of declaring a scope for that bean. For example, To force Spring to produce a new bean instance each time one is needed, you should declare the bean’s scope attribute to be prototype. Similar way if you want Spring to return the same bean instance each…