JSP is a dynamic scripting capability for web pages that allows Java as well as a few special tags to be embedded into a web file (HTML/XML, etc). The suffix traditionally ends with .jsp to indicate to the web server that the file is a JSP file. JSP is a server side technology - you can't do any client side validation with it. JSP files actually get compiled into Servlets, so what is the point? Why not just write Servlets? For most people, the benefit is twofold: The focus is on HTML. Java and the JSP extensions assist in making the HTML more functional. Servlets on the other hand allow outputting of HTML but it is a tedious process. It is easy to make a change and then let the JSP capability of the Web Server you are using deal with compiling it into a Servlet and running it. In the past, people have used servlets because of the problem of redirection - because by the time the JSP engine gets around to writing information back down the HTTP pipe, you could not do a redirect effectively in JSP - leading to the concepts of Model 1 vs Model 2 . This has been fixed in JSP 1.0 with the addition of buffered output streams.
as a few special tags to be embedded into a web file (HTML/XML, etc). The
suffix traditionally ends with .jsp to indicate to the web server that the
file is a JSP file. JSP is a server side technology - you can't do any client
side validation with it.
JSP files actually get compiled into Servlets, so what is the point? Why not
just write Servlets?
For most people, the benefit is twofold:
The focus is on HTML. Java and the JSP extensions assist in making the HTML
more
functional. Servlets on the other hand allow outputting of HTML but it is a
tedious
process.
It is easy to make a change and then let the JSP capability of the Web
Server you are
using deal with compiling it into a Servlet and running it.
In the past, people have used servlets because of the problem of redirection -
because by the time the JSP engine gets around to writing information back
down the HTTP pipe, you could not do a redirect effectively in JSP - leading
to the concepts of Model 1 vs Model 2 . This has been fixed
in JSP 1.0 with the addition of buffered output streams.
一个星期你就可以去写写项目了
如果没基础,就直接学jsp,见效快,但是如果没学基本的java语言语法类库什么的,
那也没办法学的更好啦
2.如果非要追究。是这样:JSP是面向Web开发人员开发Servlet程序的一个框架。最终,经过每个Web container自动转化成.java的Servlet源文件,然后再自动编译成.class的Servlet。这样做的目的是照顾那些web application developer。当然即便是程序员也是能够受益,因为方便和直接。不管怎么样,其实开发的都是Servlet.