Difficulty: Easy
Correct Answer: Valid (JSPs allow dynamic pages using HTML plus Java/JSP tags)
Explanation:
Introduction / Context:
JavaServer Pages (JSP) is a server-side technology that compiles to servlets, enabling dynamic content generation in web applications. This question tests a foundational understanding of what JSP is intended to do.
Given Data / Assumptions:
Concept / Approach:
A JSP page is translated to a servlet by the container. It may contain directives, scriptlets (legacy), tag libraries (JSTL), and EL to bind to Java objects. This architecture enables creation of dynamic web pages that mix presentation with server-side logic (modern best practice favors EL and tag libraries rather than scriptlets).
Step-by-Step Solution:
Verification / Alternative check:
Inspect the work directory of a servlet container (for example, Tomcat) to see generated servlet code from JSPs.
Why Other Options Are Wrong:
Common Pitfalls:
Overusing scriptlets instead of EL or tag libraries; mixing heavy business logic directly into JSPs rather than controllers.
Final Answer:
Valid (JSPs allow dynamic pages using HTML plus Java/JSP tags)
Discussion & Comments