`
sasipa90
  • 浏览: 14580 次
  • 性别: Icon_minigender_1
  • 来自: 长沙
最近访客 更多访客>>
社区版块
存档分类
最新评论

Introduction to Servlet & JSP

阅读更多
Introduction to Servlet & JSP
------------------------------------

As we did in our previous summary, we will begin by learning some new vocabulary about Servlet and JSP:

   -Servlet: Java programming language class used to extend the capabilities of servers that host applications accessed via a request-response programming model
   -JSP: Java Server Page helps developers to do dynamic web pages based on HTML or XML
   -HTML: HyperText Markup Language
   -CGI: Common Gateway Interface, here we still don’t need to understand much about it, we just take it as it is.
   -GUI: Graphical User Interface
   -URL: Uniform Resource Locator
   -MIME TYPE: Is the content-type response header’s value
   -404 Not Found:  Common error when the server can’t find what it thinks you asked for.


   The problem which makes us learn and use Servlet and JSP is that we find that if we need more people to use our applications it have to be accessed thought the internet, and as we know the web browsers use the HTML language to read and send message by HTTP protocol (Protocol used under TCP/IP, for more information….”WIKIPEDIA”). The next problem was how to make those HTML pages be dynamic. The solution to all of that was Servlet, which is a Java programming language class which is use to add servers capabilities through request-response to get and give changeable data, JSP which could write java code into a HTML file.

    But we still ask ourselves, what is the process? How all these process are going on?
The process is that our browser will send a request (by the URL) to the server asking it to give back a file, an html, a PDF, etc… The server will answer through the HTTP the response on the form of an HTML file. The request stream will be containing the HTTP method to be performed (doGet(), doPost(), or others), the page to be accessed (URL) and the parameters. The Response stream will be containing a status code which will determine if the request was successful or not, the content-type (if it is a PDF, an HTML or others) and at the end the content.

What is the difference between doGet() and doPost()?
doGet() will only go to find something back to the server while doPost() will do so and give also some data to the server. This is the case of login that our username and password must be given to the server to guaranty if it is the right user.

At the end let's talk about the URL and it’s part.
Here is an example of URL: http://localhost:8080/ServletTest/Sample/index.html

   -HTTP://  is the Protocol which tell the server which communication protocol will be used
   -“localhost” is the Server, the unique name of the physical server which can be replaced by an IP address.
   -“/ServletTest/Sample” is the path of to the location on the server of the resource being requested.
   -“index.html” is the resource name, the name of the content being requested. It can be a PDF, a picture, a music, a movie, etc…
分享到:
评论

相关推荐

    Introduction to JSP.ppt

    【JavaServer Pages (JSP) 简介】 JavaServer Pages(JSP)是一种由Sun Microsystems(现...JSP还可以结合Servlet、JavaBeans、EL(表达式语言)和JSTL(JSP标准标签库)等技术,实现更高效、更可维护的Web应用开发。

    introduction to J2EE platform

    然后,通过Servlet和JSP实现前端界面;最后,在Tomcat服务器上部署整个应用。 - **案例二:企业内部通讯系统**:本案例重点介绍如何使用JMS进行异步消息传递,以及如何利用JTA确保消息传递过程中的一致性和可靠性。 ...

    Murach-s-Java-Servlets-and-JSP, 3rd.pdf

    Murach's Java Servlets and JSP, 3rd Very good introduction on servlet and jsp.

    An Introduction to Network Programming with Java

    本书全面介绍了Java网络编程的核心概念、技术和实践方法,包括远程方法调用(RMI)、Servlet、JSP等内容。 ### 一、Java网络编程概述 Java作为一种广泛使用的编程语言,在网络编程领域有着举足轻重的地位。Java...

    An Introduction To JSTL

    在JSTL出现之前,Servlet、JSP和JavaBeans是标准的Web应用程序开发技术。JSP页面通常会通过`<jsp:useBean>`标签来调用JavaBeans以执行业务逻辑。然而,这种做法存在一些问题,如代码嵌入HTML中导致页面难以理解和...

    Introduction à JSP.ppt

    实际上,JSP引擎本身就是一个Servlet,它会解析JSP页面,将其转化为Java源代码(Servlet),然后编译和执行。 JSP的生命周期包括JspInit(), JspService()和JspDestroy()三个主要阶段。当文件改变时,会执行Servlet...

    An Introduction To Ajax

    7. **服务器端编程**:了解 Java Servlet 和 JSP 的基础知识,以及如何编写可被 DWR 调用的服务端方法。 通过深入学习这些知识点,并实际操作 "DWR-SPRING DEMO",你可以更好地掌握 Ajax 应用的开发,并理解如何...

    Oracle Solaris 9 - Introduction to Sun ONE Application Server 7-

    该服务器产品利用了 Sun 六年多的应用服务器技术经验,enable developers to rapidly build robust applications based on JavaServer Pages(JSP)技术、Java Servlet 和 Enterprise JavaBeans(EJB)技术。...

    Java_for_the_Web_with_Servlets

    - **Introduction to JSP**: JSP is a technology that simplifies the creation of dynamic web pages. It extends the capabilities of servlets by allowing developers to embed Java code directly into ...

    learning-java-introduction-real-world-programming-5th.rar

    对于希望进一步学习Java Web开发的读者,书中可能会介绍Servlet、JSP和Spring框架的基础知识。 总的来说,《Learning Java - Introduction to Real-World Programming》第五版是一本全面的Java教程,它不仅涵盖了...

    Your First Cup An Introduction to the Java EE6 Platform.pdf

    《Your First Cup: An Introduction to the Java EE Platform》是一本由Sun Microsystems出版的专业书籍,主要介绍了Java EE 6平台的基本概念、特点以及如何利用该平台进行企业级应用开发。本书作为Java EE初学者的...

    an-introduction-to-java-programming-3.rar_java programming

    "An introduction to Java programming"这本书可能是初学者的一个好起点,它应该会涵盖Java语言的基础知识,帮助读者建立起坚实的编程基础。阅读PDF文档,结合实际编程练习,将是掌握Java编程的有效途径。

    core_servlets_and_javaserver_pages_advanced_technologies_volume_2_2nd_edition

    Since then, use of servlets and JSP has continued to grow at a phenomenal rate. The Java 2 Platform has become the technology of choice for developing e-commerce applications, dynamic Web sites, and ...

    jsp编程技术复习题

    - **Introduction**:介绍通知,允许在不修改类代码的情况下为类添加新的方法或字段。通过这种方式,可以在运行时动态地增强类的功能。 #### 三、其他知识点解析 - **Hibernate的核心技术**:Hibernate的核心技术...

    外文翻译 stus MVC

    The ActionServlet (Command) passes the parameterized classes to ActionForm using the perform() method. Again, no more dreadful request.getParameter() calls. By the time the event gets here, the input ...

    java视频教程Day01 免费

    26. Introduction to JavaServer Pages (JSP介绍) 27. Creating, Deploying and Executing a JSP (生成, 部署及运行JSP) 28. Scripting (JSP脚本) 29. Working with Reusable Components (使用JavaBeans) ...

    WCD习题集[收集].pdf

    Model 1 Introduction to Web Application Technologies 本节讨论了Web应用程序技术的基础知识,包括CGI和Servlet的优缺点分析。 CGI(Common Gateway Interface)的优缺点 优点: 1. 可以使用多种编程语言编写...

    Tomcat The Definitive Guide, 2nd Edition(PDF)

    It takes a book as versatile as its subject to cover Apache Tomcat, the popular open source Servlet and JSP container and high performance web server. Tomcat: The Definitive Guide is a valuable ...

Global site tag (gtag.js) - Google Analytics