Hi divakarreddy welcome to Javaranch , Firstly your name does not follow the Javaranch naming policy . Please change it using the My Profile link above. Then consider editing your post to give it a UseAMeaningfulSubjectLine . This will ensure that you get more useful responses.
why cgi overcome in servlet?
I am not getting what you are asking here. Do you mean to ask : How servlets overcome CGI ?
Also please take some time to read the Ask good questions link below.
This is the set of conventions for handling HTTP requests on the server side by which request parameters are parsed for use by a server application. Historically, Perl was the pioneer language in this area. Subsequent development for Java, PHP and etc have naturally stuck to these conventions as much as possible.