Difference between HTML and JSP
Key difference: HTML stands for HyperText Markup Language. It is a well known mark up language used to develop web pages. It has been around for a long time and is commonly used in webpage design. JSP stands for JavaServer Pages. It is mainly used to develop dynamic web pages. The JSP technology allows for fast development and easy maintenance of the said information-rich, dynamic web pages. JSP web pages are based on HTML, XML, or other document types.
HTML stands for HyperText Markup Language. It is a well known mark up language used to develop web pages. It has been around for a long time and is commonly used in webpage design. XML or Extensible Markup Language defines a set of rules for encoding documents in a format that can be read by both, human and computer.
HTML is written using HTML elements, which consist of tags, primarily and opening tag and a closing tag. The data between these tags is usually the content. The main objective of HTML is to allow web browsers to interpret and display the content written between the tags. The tags are designed to describe the page content. HTML comes with predefined tags. They allow one to insert images, text, videos, forms and other pieces of content together into a cohesive webpage.
JSP stands for JavaServer Pages. It is mainly used to develop dynamic web pages. The JSP technology allows for fast development and easy maintenance of the said information-rich, dynamic web pages. JSP web pages are based on HTML, XML, or other document types. They also need a compatible web server with a servlet container, such as Apache Tomcat or Jetty, in order to run.
JSP was first released by Sun Microsystems in 1999. Sun Microsystems was eventually taken over by Oracle Corporation. JSP is considered to be similar to PHP; however JSP is based on the Java programming language. As JSP is a Java program, it must be executed within a Java Virtual Machine (JVM), especially one that integrates with the server's host operating system to provide an abstract platform-neutral environment.
JSP also enables rapid development of Web-based applications that are platform independent. Furthermore, the technology of JSP allows designers to change the overall page layout without changing the underlying dynamic content. JSP can also be used independently or as the view component of a server-side model–view–controller design.
JSPs are usually used to deliver HTML and XML documents; however, through the use of OutputStream, they can deliver other types of data as well. JSP also allows Java code and certain pre-defined actions to be interleaved with static web markup content. This results in the page being compiled and executed on the server to deliver a document. The compiled pages, as well as any dependent Java libraries, use Java bytecode rather than a native software format.
Some differences between HTML and JSP:
- JSP pages add server-side code to an HTML page.
- JSP creates dynamic pages, while HTML creates static pages.
- JSP is a server-side scripting language, whereas HTML is a client-side scripting language.
- HTML pages provide emphasis on appearance, semantics and layout of the Information in the browser. JSP pages can invoke built-in functionality from the server.
- HTML runs in the Web Browser. JSP runs directly on the Web Server and local JVM.
- HTML provides a means to describe the structure of text-based information in a document. JSP provides a dynamic interface for continuously changing data and dynamically invokes server actions.
- HTML loads faster as it runs on the local machine. JSP takes some time to load as it has to interact with Web Server.
Image Courtesy: teamtreehouse.com, tutorialspoint.com