Skip to content
Related Articles

Related Articles

Difference between JavaScript and JSP
  • Difficulty Level : Basic
  • Last Updated : 01 Oct, 2020

JavaScript is a lightweight and object-oriented scripting language used to create dynamic HTML pages with interactive effects within a webpage. It is an interpreted scripting language and its code is run in a web browser. It is also called a browser’s language and can be used for client-side developments as well as server-side developments. It was developed by Brendan Eich at Netscape and was first released in 1995. 
Features of JavaScript:  Some important features of JavaScript are : 

  • It is a lightweight scripting language.
  • It is platform-independent, it can run anytime on any platform or any browser.
  • It can handle date and time easily as it has in-built functions for date and time.
  • It allows dynamic typing, define types of the variable on the basis of stored value.
  • It provides support for Object-Oriented programming.
  • It reduces the load on the server by providing greater control to the browser itself.

Example: 

javascript




<script type="text/javascript"
    document.write("Hello Geeks, Greetings from GeeksforGeeks"
</script> 

JSP stands for Java Server Pages, are a dynamic web technology based on servlet container and Java EE specification which is used to generate dynamic web content in webpages. It was launched in the year 1999. It serves as a server-side technology based on various content formats such as XML or HTML or any other type of document contents. 
 

Features of JSP: Some important features of JSP are : 



  • It is an expression language for the server-side.
  • It is easy to code as it allows tag-based programming.
  • It is platform-independent, it can run anytime on any platform or any browser.
  • It allows the building of dynamic web pages which helps to interact with the users in a real-time environment.
  • It primarily connects with the server which provides an easy connection to the database.

Example: 
 

html




<html>
   <head><title>Hello!</title></head>
   <body>
      Hello Geeks!<br/>
      <%
         out.println("Welcome to Geeksforgeeks");
      %>
   </body>
</html>

Difference between JavaScript and JSP: 

S.No.JavaScriptJSP
1.It is a lightweight and object-oriented scripting language.It is a web technology based on servlet container and Java EE specification.
2.It can add dynamic features to the webpage without any limitations.It can also add dynamic features to the webpage but limitations will be there.
3.It needs JavaScript engine to run the code.It needs a web server or application based on servlet for deploying of webpages.
4.It is maintained by ECMA TC-39 committee.It is maintained by the ava Specification group.
5.It does job as both server-side and client-side scripting language.It does the job on the server-side using servlet technology through a web server.
6.It is not possible to embeed HTML in between JavaScript.Java Server Pages used scriptlets to add Java code in between HTML.
7.It is simpler and easier to develop large and complex web projects using JavaScript.It is difficult for developers to develop large projects using JSP.
My Personal Notes arrow_drop_up
Recommended Articles
Page :