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 [...]
Archive for October, 2008
Attribute and Listener
Posted in Servlet on October 23, 2008 | 1 Comment »
string in java
Posted in Java on October 13, 2008 | Leave a Comment »
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 [...]
Forward Vs Redirect
Posted in Java on October 7, 2008 | Leave a Comment »
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 [...]