Explain Advantages of JSP over Servlets

 Advantages of JSP over Servlets

  • Servlets use printIn statements for printing an HTML document which is usually very difficult to use. JSP has no such tedious task to maintain.
  • JSP needs no compilation, CLASSPATH setting, and packaging.
  • In a JSP page, visual content and logic are separated, which is not possible in a servlet.
  • There is the automatic deployment of a JSP, recompilation is done automatically when changes are made to JSP pages.
  • Usually, with JSP, Java Beans, and custom tags web application is simplified. 
                    OR,

Advantages of JSP over Servlet

There are many advantages of JSP over Servlet. They are as follows:

1) Extension to Servlet

JSP technology is an extension of Servlet technology. We can use all the features of the Servlet in JSP. In addition, we can use implicit objects, predefined tags, expression language, and Custom tags in JSP, which makes JSP development easy.

2) Easy to maintain

JSP can be easily managed because we can easily separate our business logic from presentation logic. In Servlet technology, we mix our business logic with the presentation logic.

3) Fast Development: No need to recompile and redeploy

If the JSP page is modified, we don't need to recompile and redeploy the project. The Servlet code needs to be updated and recompiled if we have to change the look and feel of the application.

4) Less code than Servlet

In JSP, we can use many tags such as action tags, JSTL, custom tags, etc. that reduce the code. Moreover, we can use EL, implicit objects, etc.

                         or,

Advantage of JSP over Servlet

JSP

  • Allows tag-based programming. So extensive Java knowledge is not required.
  • Suitable for both java and non-java programmer.
  • Use nine implicit objects, which we can use directly in our JSP program.
  • Modification done in the JSP program will be recognized by the underlying server automatically without reloading the web application.
  • Takes care of exception handling.
  • Allows us to use separate presentation logic (Html code) from Java code(business logic).
  • Increases readability of code because of tags.
  • Gives built-in JSP tags and also allows to development of custom JSP tags and to use the of third-party supplied tags.
  • Easy to learn and easy to apply.

Servlet

  • Does not allow tag-based programming. So extensive java knowledge is required.
  • Not suitable for non-java programmers.
  • Implicit objects are present but we can’t use them directly. We need to write additional code to use them.
  • Here we need to compile and reload manually.
  • Does not take care of exception handling. Programmers have to explicitly handle this.
  • Does not allow.
  • The readability of code is less
  • Does not allow tag-based programming.
  • Not easy compared to JSP.


Comments

Popular posts from this blog

Suppose that a data warehouse for Big-University consists of the following four dimensions: student, course, semester, and instructor, and two measures count and avg_grade. When at the lowest conceptual level (e.g., for a given student, course, semester, and instructor combination), the avg_grade measure stores the actual course grade of the student. At higher conceptual levels, avg_grade stores the average grade for the given combination. a) Draw a snowflake schema diagram for the data warehouse. b) Starting with the base cuboid [student, course, semester, instructor], what specific OLAP operations (e.g., roll-up from semester to year) should one perform in order to list the average grade of CS courses for each BigUniversity student. c) If each dimension has five levels (including all), such as “student < major < status < university < all”, how many cuboids will this cube contain (including the base and apex cuboids)?

Suppose that a data warehouse consists of the four dimensions; date, spectator, location, and game, and the two measures, count and charge, where charge is the fee that a spectator pays when watching a game on a given date. Spectators may be students, adults, or seniors, with each category having its own charge rate. a) Draw a star schema diagram for the data b) Starting with the base cuboid [date; spectator; location; game], what specific OLAP operations should perform in order to list the total charge paid by student spectators at GM Place in 2004?

Explain Parallel Efficiency of MapReduce.