What is the basic difference b/w JSP & Servlets? Why did JSPintroduced when we had Servlets
A JSP page is "transleted" into java code which isthen compiled into a servlet. You can write a servletin java code and compile it yourself.
short answer - not a lot - jsp compiles to a servlet.longer answer - you would tend to use jsp when you have some (html orother) display componentbut not necessarily so, you can do anything with jsp that you can dowith a servlet and more.jsp's do tend to be easier to find on a server(the url doesn't have to have /servlet/ in it or be specifically mappedto somewebapp url space)a jsp usually lives with the html content of your webapp........
IMHO,When your page is more of HTML and less computation, then it isbetter to use JSP and Vice-versa. Another advantage is, you cld useWYSWYG editors to create JSP, I like that option as it is easy todesign pages that way.
the very basic difference is servlet-html in javajsp-java in html
servlet: its a java class so for every change we have tocompile the code to reflect the change.Mainly using forwriting business logics.jsp:its a file, its automatically converted into a servleton deploying. We can’t compile it explicitly.the changeswill get reflect by saving the file.Its mainly used forpresentation of data.....