This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I know every JSP is translated into Servlet and JSP could better act as a presentation layer. A JSP can do all that a Sevlet can do. Then what is the main difference between both of them? Servlets are preferred to be used for business logic. Why not JSP's when JSP also is finally a servlet?
Because if you'll use an MVC layout, you'll have to keep your presentation separated from your logic (you've said you already know it)
Why not JSP's when JSP also is finally a servlet?
There are so much things you can do nowadays This is good and bad. Why ? Because you can also do a lot of crap. You may use a JSP to act as a servlet. After all, there's also a tag in web.xml for it. But, should you really use it ?
Think about it this way - when you write a JSP page, you aren't really writing a servlet. It's more like a template - you provides a mix of HTML telling how the page looks, along with tags to let the page "hook into" other parts of your web application. Later the application server comes along and uses this template that you wrote to produce a servlet that is specialized for displaying the HTML page you wrote in the template.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.