> so why ejb came
Do you even know the difference between a servlet and an enterprise javabean?
Enterprise javabeans are no replacement, they are an extension. At the very core of java web development there are always servlets because that is the only thing we have: a servlet container. But there are many technologies and frameworks to build on top of those servlets to make java web development easier and (in most cases) faster. Enterprise javabeans is one of those technologies. JSPs are another and a framework like Struts or Spring yet another.