孙老师,为了证实我的猜测,去Sun的网站看了两篇文章,摘录如下:
以下摘自 http://java.sun.com/products/jsp/faq.html#4
Whydo
I need JSP technology if I already have servlets?
JSP pages are compiled into servlets, so theoretically you could write servlets to support your web-based applications. However, JSP technology was designed to simplify the process of creating pages by separating web presentation from web content. In many applications, the response sent to the client is a combination of template data and dynamically-generated data. In this situation, it is much easier to work with JSP pages than todo
everything with servlets.
以下摘自 http://java.sun.com/products/jsp/
JavaServer Pages technology is an extension of the JavaTM Servlet technology. Servlets are platform-independent, 100% pure Java server-side modules that fit seamlessly into a web server framework and can be used to extend the capabilities of a web server with minimal overhead, maintenance, and support. Unlike other scripting languages, servlets involve no platform-specific consideration or modifications;
they are Java application components that aredo
wnloaded, on demand, to the part of the system that needs them. Together, JSP technology and servlets provide an attractive alternative to other types of dynamic web scripting/programming that offers platform independence, enhanced performance, separation of logic from display, ease of administration, extensibility into the enterprise and most importantly, ease of use.
以下摘自 http://java.sun.com/products/servlet/
You might want to check out the latest information on JavaServer PagesTM (JSPTM) technology. JSP technology is an extension of the servlet technology created to support authoring of HTML and XML pages. It makes it easier to combine fixed or static template data with dynamic content. Even if you're comfortable writing servlets, there are several compelling reasons to investigate JSP technology as a complement to your existing work.
看过以上两段话,我又想出一个比较恰当的比喻(我认为)。好比Servlet是汇编,JSP+Bean是C
从历史长河来看,毕竟还是 C代替了 汇编,因为它有很多的好处,如使用简单,功能强大等等。
但汇编也不能完全被替代,某些特定的场合,还是需要汇编的优点,如运行快,功能更强。
如果不怕麻烦,汇编的程序当然可以实现C的功能,但是一般情况下,毕竟已经没有必要用汇编了,会用的人也的确越来越少。
其实我根本不懂什么叫"Servlet",以上只是根据一些材料的字面意思猜测得来,不对之处,请孙老师指正!谢谢!
有人还是拥护Servlet,列举了JSP的一些问题,您可以参考一下:(抱歉,我没有看完)
http://www.servlets.com/soapbox/problems-jsp.html
http://www.servlets.com/soapbox/problems-jsp-reaction.html