JSP Mock Test



This section presents you various set of Mock Tests related to JSP Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Questions and Answers

JSP Mock Test III

Answer : C

Explaination

The isELIgnored option gives you the ability to disable the evaluation of Expression Language (EL) expressions. The default value of the attribute is true, meaning that expressions, ${...}, are evaluated as dictated by the JSP specification. If the attribute is set to false, then expressions are not evaluated but rather treated as static text.

Q 3 - What is default value of isELIgnored Attribute?

A - true

B - false

Answer : A

Explaination

The default value of the attribute is true, meaning that expressions, ${...}, are evaluated as dictated by the JSP specification. If the attribute is set to false, then expressions are not evaluated but rather treated as static text.

Answer : C

Explaination

The buffer attribute specifies buffering characteristics for the server output response object.

Answer : A

Explaination

When buffer is set to "none", servlet output is immediately directed to the response output object.

Answer : C

Explaination

The autoFlush attribute specifies whether buffered output should be flushed automatically when the buffer is filled, or whether an exception should be raised to indicate buffer overflow.

Q 7 - What is default value of autoFlush Attribute?

A - true

B - false

Answer : A

Explaination

A value of true (default) indicates automatic buffer flushing and a value of false throws an exception.

Answer : A

Explaination

A value of true (default) indicates automatic buffer flushing and a value of false throws an exception.

Answer : B

Explaination

The extends attribute specifies a superclass that the generated servlet must extend.

Answer : C

Explaination

The import attribute serves the same function as, and behaves like, the Java import statement. The value for the import option is the name of the package you want to import.

Answer : A

Explaination

The info attribute lets you provide a description of the JSP.

Answer : D

Explaination

The isThreadSafe option marks a page as being thread-safe. By default, all JSPs are considered thread-safe. If you set the isThreadSafe option to false, the JSP engine makes sure that only one thread at a time is executing your JSP.

Answer : D

Explaination

The session attribute indicates whether or not the JSP page uses HTTP sessions. A value of true means that the JSP page has access to a builtin session object and a value of false means that the JSP page cannot access the builtin session object.

Answer : C

Explaination

The isELIgnored option gives you the ability to disable the evaluation of Expression Language (EL) expressions. The default value of the attribute is true, meaning that expressions, ${...}, are evaluated as dictated by the JSP specification. If the attribute is set to false, then expressions are not evaluated but rather treated as static text.

Q 15 - What is the default value of isELIgnored attribute?

A - true

B - false

Answer : A

Explaination

The default value of isELIgnored attribute is true, meaning that expressions, ${...}, are evaluated as dictated by the JSP specification.

Answer : A

Explaination

If the attribute is set to false, then expressions are not evaluated but rather treated as static text.

Answer : C

Explaination

The isScriptingEnabled attribute determines if scripting elements are allowed for use. The default value (true) enables scriptlets, expressions, and declarations. If the attribute's value is set to false, a translation-time error will be raised if the JSP uses any scriptlets, expressions (non-EL), or declarations.

Q 18 - What is the default value of isScriptingEnabled attribute?

A - true

B - false

Answer : A

Explaination

The default value (true) of isScriptingEnabled attribute enables scriptlets, expressions, and declarations.

Answer : A

Explaination

A translation-time error will be raised if the JSP uses any scriptlets, expressions (non-EL), or declarations.

Answer : C

Explaination

The include directive is used to includes a file during the translation phase. This directive tells the container to merge the content of other external files with the current JSP during the translation phase.

Q 21 - Is it possible to include files using absolute path in a JSP page using include directive?

A - true

B - false

Answer : A

Explaination

No! include directive takes relative URL with respect to current domain of web application.

Answer : A

Explaination

Compilation, Initialization, Execution, Cleanup is the correct order.

Q 23 - Which of the following step is taken by JSP container during Compilation phase?

A - Parsing the JSP.

B - Turning the JSP into a servlet.

C - Compiling the servlet.

D - All of the above.

Answer : C

Explaination

The compilation process involves three steps: a) Parsing the JSP, b) Turning the JSP into a servlet, c) Compiling the servlet.

Answer : A

Explaination

When a container loads a JSP it invokes the jspInit() method before servicing any requests.

Answer : D

Explaination

Whenever a browser requests a JSP and the page has been loaded and initialized, the JSP engine invokes the _jspService() method in the JSP.The _jspService() method of a JSP is invoked once per a request and is responsible for generating the response for that request and this method is also responsible for generating responses to all seven of the HTTP methods ie. GET, POST, DELETE etc.

Answer Sheet

Question Number Answer Key
1 A
2 C
3 A
4 C
5 A
6 C
7 A
8 A
9 B
10 C
11 A
12 D
13 D
14 C
15 A
16 A
17 C
18 A
19 A
20 C
21 A
22 A
23 C
24 A
25 D
jsp_questions_answers.htm
Advertisements