Difficulty: Easy
Correct Answer: Invalid (JSPs compile to servlets/bytecode and are platform-independent under a JVM)
Explanation:
Introduction / Context:
JSPs are part of the Java web stack. Like Java classes, JSPs ultimately execute as bytecode inside a servlet container, which runs on any OS with a compatible JVM. This question examines whether JSPs lose Java’s portability benefits.
Given Data / Assumptions:
Concept / Approach:
A JSP is translated into a Java servlet and compiled to bytecode. The same .war file can be deployed on any supported OS where the container and JVM run. Any departure from portability stems from the application’s own native dependencies, not from JSP technology itself. Therefore, claiming JSPs are not machine-independent is incorrect.
Step-by-Step Solution:
Verification / Alternative check:
Deploy the same WAR on Windows, Linux, and macOS Tomcat instances; behavior is identical given the same JVM and configuration.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing server-side portability with client-side differences; relying on native binaries in the app, which do reduce portability.
Final Answer:
Invalid (JSPs compile to servlets/bytecode and are platform-independent under a JVM)
Discussion & Comments