Feeds:
Posts
Comments

Archive for October, 2008

Attribute and Listener

Attributes and Listeners:
 
Servlet init parameter:
            In order to hardcode the value in the servlet, we can put(configure) that value in the Deployment Descriptor(DD). For example
 
            Printwriter out = response.getWriter();
            Out.printl(boo@gmail.com);
 
Instead of hard coding like this we can mention this value in DD, by that without touching the servlet, he can change the value in DD [...]

Read Full Post »

string in java

Statement 1
String s1 = “hello world”;
Statement 2
String s2 = new String( “hello world” );
Wha is the difference between the above two statements?
Statement 1 means: String variable s1 refers to a string “hello world” in the string pool maintained by JVM. Thus, JVM first searches for the string “hello world” in the string pool. If it [...]

Read Full Post »

Forward Vs Redirect

A Controller servlet may perform either a forward or a redirect operation at the end of processing a request. It is important to understand the difference between these two cases, in particular with respect to browser reloads of web pages.
Forward

a forward is performed internally by the servlet
the browser is completely unaware that it has taken [...]

Read Full Post »