Unit 4: JavaServer Pages - Subjective Questions

CSE406 — Advanced Java Programming • Practice Questions with Detailed Answers

20 questions

1

Define JavaServer Pages (JSP). Explain its role in developing Java web applications.

2

Describe the complete lifecycle of a JSP page.

3

Explain the lifecycle methods jspInit(), _jspService(), and jspDestroy(). State whether a JSP author can override each method.

4

Describe the standard directory structure of a JSP-based web application.

5

What is the JSP API? Explain its major packages, interfaces, and classes.

6

Define a JSP scriptlet tag. Explain its syntax, execution, and limitations with an example.

7

What is a JSP expression tag? Explain how it differs from a scriptlet that calls out.print().

8

Explain the JSP declaration tag. How does a variable declared in a declaration differ from one declared in a scriptlet?

9

Compare JSP scriptlet, expression, and declaration tags with respect to syntax, generated location, and purpose.

10

What are JSP implicit objects? List the standard implicit objects and state their purposes.

11

Explain the request, response, and out implicit objects, including one typical use of each.

12

Distinguish between the page, pageContext, config, and application implicit objects.

13

Explain JSP attribute scopes and describe how pageContext can be used to manage scoped attributes.

14

Explain the session and exception implicit objects. Under what conditions can each object be used?

15

What are JSP action tags? Explain their general syntax and how they differ from JSP scripting elements.

16

Describe the <jsp:include> action. Compare it with the JSP include directive.

17

Explain the <jsp:forward> and <jsp:param> action tags with an example. How is forwarding different from redirection?

18

Explain the <jsp:useBean> action and the significance of its id, class, type, and scope attributes.

19

Describe the <jsp:setProperty> and <jsp:getProperty> action tags. Explain the meaning of property="*".

20

Develop and explain a JSP-based flow that receives user data, stores it in a JavaBean, and displays it on another page using JSP action tags.