Posts

Servlet -- Intricacies to be known

First : it is necessary that you have to start with "/" in <url-pattern> tag like below, if you omit the "/", the tomcat server or any other we server will ail to start saying invalid url patter matcher. <servlet-mapping> <servlet-name>Hello</servlet-name> <url-pattern> /Hello </url-pattern> </servlet-mapping> Second : the url pattern get match strictly with what you had specify in <url-pattern> tag, So if have written like : <url-pattern> /Hello </url-pattern> then, the browser will run the associated servlet to this url when you type specifically: http://localhost:8080 /Hello only. http://localhost:8080 /Hello/  will not work and say requested page not found. Third :  if you have specified <welcome-file>default.html | .jsp | .htm</welcome-file> but you have not matched the root path "/" to any servlet, i.e, <url-pattern> / </url-pattern> has not de...

"this", "bind" , "apply" and "call"

/** * lets understand the most notorious and complex topic which always * ditch even a pro javascript programmer. * "this", "bind" , "apply" and "call".  */ /************************** EXAMPLE 1 **************************************/ /************** "this" ******************* * just to distinguish English language word this from js keyword this, I will notate the * JS keyword this within "this", however you gotta use the keyword in programmes as plain this. * * "this" is a JS keyword which notates the current object which invokes the function. * Please pay attention "object which invokes the function". * * "object which invokes the function" is the phrase if you remember, will never get confused. * * Also remember, "this" is not associated to an object until it is get called by the object. * means , JS decides during runtime the value of "th...