Question
I have question and 2 answer for this question below that, give comment about these two answer and Feel free to agree or disagree with
I have question and 2 answer for this question below that, give comment about these two answer and Feel free to agree or disagree with it (in 2 or 3 short paragaraph) and for each answer write seprated comment (NOT TOGHETHER) Be detailed in your postings. Please ensure that your postings are civil and constructive
Question:
JSP compiler transforms the page to a Servlet. Discuss this process and how it affects page loading in relation to changes one makes to the page.
Answer1: A JSP page is translated into servlet code, which is represented as a .java file in what is known as a "translation phase." This .java file is then compiled into the bytecode .class file which is executed and the output HTML document is created and sent back to the client. This process seems complicated, but it does not affect the page loading performance because after the first invocation of a JSP, any other requests with go straight to the already compiled .class file. JSPs are meant to be compliments to servlets, not replacements. In a MVC design, servlets represent the controller and the JSPs become the view to the user. The separation of static and dynamic contents in a JSP makes it easy to maintain and quick to learn how to use.
Answer2:
JavaServer Pages (JSP) introduce an alternative to separate HTML from Java code. This introduces many advantages because it separates code by its purposes which increases the coherence and coupling of the servlets. Although a JSP looks different than servlet, a JSP is essentially the same as a servlet. This is because before the JSP code is compiled, it is converted to a format similar to the one of a servlet. In its servlet format, the JSP code is then compiled completing its preparation for runtime. This process, however, doesnt occur until the first request for the JSP arrives. If any changes are made in the JSP code, it will be recompiled the next time a user requests that JSP. Nevertheless, there are exceptions. For instance, some JSP engines will pre-compile the JSP and have it ready for when it is requested by a client.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started