A servlet is a Java programming language class that is used to extend the capabilities of servers that host applications accessed by means of a request-response programming model. Although servlets can respond to any type of request, they are commonly used to extend the applications hosted by web servers. ( more reference ).
Thursday, 9 October 2014
Tuesday, 30 September 2014
How to detect width of text inside text box
In this tutorial we are going to see how to calculate the width of text inside the text box. First of all we need to know why we are trying to achieve this. This is useful when you want to position some text suggestion just beneath the user cursor inside the text box. The image given below will provide better understanding of the scenario.
Wednesday, 20 August 2014
Javascript event capturing and bubbling
JavaScript uses two models for event delegation, capturing and bubbling. If you go back in old days, Netscape said that event on parent will take place first and Microsoft said that event on target element will take first. The W3C model combines both capturing and bubbling by saying that an event first makes its way downwards visiting captures i.e parent to target child and then bubbles back visiting non captures. Lets explore further
Monday, 21 July 2014
Enable caching in tomcat 6
In previous tutorial we learnt how to enable caching in tomcat 7. In this tutorial we will learn how to enable caching in tomcat 6. Tomcat 6 doesn't comes with inbuilt ExpiresFilters like in tomcat 7, but we can write our own filter to achieve caching. Two headers "Cache-control" and "Expires" are needed to be set so that browser can determine when to load resource from server or cache.
Thursday, 17 July 2014
Enable caching in tomcat 7
Caching is technique of storing files for future use. In we take it in context of website performance, caching helps browser to store different resources from server in local storage. Whenever a user request for resource browser first checks it cache and if it is available the resource is served from cache. This reduces network bandwidth and increases performance of your website. ( how to speed up your website )
Wednesday, 16 July 2014
Debugging java code in eclipse
Debugging is referred as watching the source code and variables of the program during execution. The stop point or break point is specified in the code where the execution is paused by the debugger. Then you can use step over, step into commands to go to next statement for execution. In this tutorial we are going to use java debugger that comes in eclipse. The eclipse used for demonstration is eclipse juno. Eclipse has special perspective for debugging allowing investigation for variables or execution statements.
Tuesday, 8 July 2014
Mysql connection very slow
There can be many reasons that cause slow execution of mysql command, possibly amount of memory, cpu, database size, database engine and many more. In this tutorial we are going to talk about the connection being slow for mysql, your queries are running faster from command line but your web page scripts are not able to make connection faster. Response time from mysql is taking longer than usual. The major cause can be the DNS lookup. So how to fix this ?