Source from : http://www.pearsonitcertification.com/articles/article.aspx?p=29786&seqNum=3
The Internet's original purpose was to access and copy files from one computer to another far away (they already had short distance networks by then, but they were expensive, proprietary, and not ready for mass consumption). While TCP/IP provided a highway layer, the File Transfer Protocol (FTP) specification provided a standard way to exchange those files. It defined a way of shuttling them back and forth, but said nothing about looking at the content. HyperText Markup Language (HTML) allowed us to see the documents on the Internet. FTP can transmit HTML files just as easily as HTTP can. But we use Hypertext Transfer Protocol (HTTP) to act as an FTP specifically for HTML documents because it is a connectionless/ stateless protocol which makes having many short connections more efficient.
Now that we have discussed the plumbing, our attention turns to the content. What files should be published? Perhaps our data isn't in files, but in databases. Some of the content is old, but the majority of data is only days old. This immediacy drives traffic on the Internet.
With HTML running over HTTP, an end user can browse files housed on a distant server. This is useful, but live data is even better. The Common Gateway Interface (CGI) specification allowed a Web server to reach beyond the file server and grab data from corporate databases. This also meant that CGI could change the HTML on-the-fly. The CGI specification was a major breakthrough in Web application development. The standard made sure that the same CGI program worked on different Web servers.
CGI became the most common means of delivering dynamic content. Alas, the pressure of the Internet was too much. CGI's performance just couldn't keep up because of a technical glitch where each request for a CGI script spawned a separate process. This design nibbled server resources off-hours but devoured them during peak loads. Further demand came, but, fortunately, better solutions came also. Functionality and scalability became key. Plain file-returning Web servers, even CGI-enabled ones, needed to mature into true application servers.
Many CGI derivatives sprouted as server-side programming solutions that implement business logic, including ASP, ColdFusion, PHP, and Perl. Java surpassed them all due to portability and its object oriented programming design.
Java has come a long way since its inception in 1991 when Sun launched "Project Green," which tried to integrate digitally controlled consumer devices like TV sets, CD players, and computers. OAK (a name which comes from an oak tree outside Gosling's window!) was born, but didn't come to life until HotJava and applets. This was a humble beginning. Sun threw the gauntlet down in 1995 by releasing Java as open source. The feedback was tremendous, and fixed more than just a few bugs. This drove Java deep into the server- side development industry.
Naturally, Sun packed Java with Internet functionality, and in June 1997 Sun announced the servlet interface. Servlets targeted CGI. Unlike CGI, which starts a process for each request, Servlets run in a single process using finer grain threads instead. Servlets represent a more efficient architecture, helping them withstand the Internet's mercurial crush. How can we possibly keep up? It's hard, but we can do it with Java servlets, which provide the foundation for developing Java Web components. One advantage to servlets is that the additional overhead for each additional simultaneous request the servlet handles is very small.
Servlets require real Java programming skills. However, the look and feel belongs to the marketing team. So, what can the graphics people do? They can thank Sun for JavaServer Pages (JSP), which was released in 1998. Inspired, some say copied, by the immensely successful Microsoft ASP, Sun made it easy to write dynamic HTML pages. With JSP, the marketing team can do their work, and with servlets the engineers can do theirs. Together, servlets and JSPs pages enable you to develop modular, maintainable, scalable, and portable Web applications. Another advantage is how Java provides a separation between JSPs, which are created by the marketers, and the JavaBeans they use, which are created by the engineers.
相关推荐
JSP和Servlet通常一起工作,JSP负责生成动态内容,而Servlet则处理业务逻辑和数据操作。随着Model-View-Controller(MVC)设计模式的流行,诸如Spring MVC、Struts等框架的出现,JSP的角色逐渐转变为视图组件,实现...
### 使用 JSP Servlet上传文件知识点解析 #### 一、概述 在Java Web开发中,文件上传是一项常见的功能需求。本文将详细介绍如何利用JSP(JavaServer Pages)与Servlet技术实现文件上传的功能。通过分析给定的HTML...
4. **GWT的History机制与JSP的URL重写**:GWT的History机制允许在不刷新整个页面的情况下改变URL,与JSP的URL重写结合,可以实现友好的SEO(搜索引擎优化)和书签功能。 5. **GWT与JSP的安全集成**:GWT可以用来...
response.sendRedirect("main.jsp"); } else { // 验证失败,返回错误信息 response.setContentType("text/html;charset=utf-8"); response.getWriter().write("<script>alert('用户名或密码错误!');history....
基于BootStrap+JSP+Servlet+Mysql的模拟咖啡厅点餐系统源码+数据库+项目说明.zip # 一个简易的模拟咖啡厅点餐系统 ## 主要使用了JSP+Servlet+Mysql来进行开发,不含后端框架 ### 其他技术: 1. Bootstrap做前端...
`forward()` 方法属于 `javax.servlet.RequestDispatcher` 类,它允许你将请求转发到服务器上的另一个资源,如Servlet、JSP页面或静态HTML文件。这种方式是服务器端的跳转,客户端(浏览器)无感知,地址栏中的URL...
<a href="javascript:history.go(-1)">返回上一页 <h2><font color=#DB1260>JSP Error Page</font></h2> 异常信息: ()%>: ()%> System.out.println("Header."); Enumeration<String> e = request.getHeaderNames()...
`forward()` 是通过`javax.servlet.RequestDispatcher`接口实现的,它允许将请求转发到另一个资源,如另一个JSP页面或Servlet。这种方法不会改变浏览器地址栏中的URL,也不会创建新的HTTP请求。 ```java ...
- **JSP**: Java Server Pages 的缩写,是一种基于Java Servlet以及整个Java体系的Web开发技术。 - **技巧**: 在JSP开发过程中能够提高效率、简化代码或解决特定问题的方法或策略。 #### 描述解读 - **超多超赞**: ...
总结:本文档涵盖了JSP中的高级概念,包括自定义MVC模式、多层架构、Servlet生命周期、过滤器使用,以及Java基础的线程安全、反射和序列化等核心知识点。这些知识对于理解和开发基于JSP的Web应用程序至关重要。理解...
在Servlet中,我们可以按照以下步骤使用 JSP SmartUpload: 1. 创建 `SmartUpload` 对象实例。 2. 初始化 `SmartUpload`,设置上传文件的临时目录和最大大小等配置。 3. 使用 `SmartUpload` 的 `upload()` 方法开始...
3. `history.jsp`:历史记录页面,可能用于展示用户的浏览历史或系统操作日志。在JSP中,可以通过访问数据库查询历史记录,并在页面上显示出来,提供用户查阅。 4. `1.txt`:这是一个文本文件,可能包含了系统配置...
- 在JSP页面中通过内嵌的Java代码或调用Servlet动态生成图片标签。 5. **额外注意事项**: - 文件大小限制与临时存储路径设置。 - 错误处理与异常捕获。 #### 代码分析 - **前端表单**:`test_upload.htm` `...
JSP页面会被服务器转换成Servlet,然后由Servlet处理请求并生成响应。 **2. 验证码原理** 彩色验证码的核心是生成一张包含随机字符的图片,并且字符的颜色、大小、位置以及背景均具有一定的随机性和复杂性,以增加...
- **问题描述**:JSP与传统的CGI以及Servlet有何不同。 - **解决方案**:JSP是基于Servlet技术的一种简化版本,它允许在HTML代码中嵌入Java代码。与CGI相比,JSP提供了更好的性能和安全性;而与Servlet相比,JSP更加...
4. **JSP与Servlet交互**:JSP本质是Servlet的简化版,用于编写动态网页。在JSP中,我们可以通过`<jsp:include>`标签或者自定义标签库(Tag Library)与后端Servlet进行交互,传递和处理请求信息,包括当前位置。 5...
【JavaWeb】是Java技术在Web开发领域的应用,它涵盖了Servlet、JSP、JavaBean等组件,以及Spring、Struts、Hibernate等框架。JavaWeb允许开发者构建动态、交互式的Web应用程序。在图书管理系统中,JavaWeb主要用于...
8. DOM对象与函数:`getElementById()`是`document`对象的方法,`screen`、`getElementByName()`和`history`不是。 9. 会话管理:在Web开发中,`Session`对象常用于实现会话跟踪。 10. Servlet配置:`servlet-...
8. DOM对象:`document`对象是浏览器对象模型的一部分,`getElementById()`和`getElementByName()`是它的方法,但`screen`和`history`不是,选项B和D错误。 9. 会话管理:`Session`对象在Web开发中用于实现会话跟踪...