Chapter 7. Using JSP: Being a JSP Flashcards

1
Q

In JSP what’s the scriptlet tag? What does it do?

A

Allows you to write regular Java code inside of a JSP page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a JSP Directive? What’s an example of a directive?

A

import is one of the first directives you’ll come across.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Within JSP what’s the tag for an Expression? How does it differ from a Scriptlet?

A

It automatically prints the return out. No need to do an out.println() statement!

IMPORTANT: Contents of an expression are passed to an out.println() SO no semicolon.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Within JSP what’s a declartion? What’s the syntax and how is it useful?

A

%!

It’s useful because you’re declaring MEMBERS of the generated servlet class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the three JSP lifecycle methods?

A

jspInit()

jspDestroy()

_jspService()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the JSP implicit objects?

A

–Important Ones–

out

request

response

session

config

application

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What’s the JSP comment tag?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you add parameters for a JSP to the Deployment Descriptor?

A

Same way you would a normal servlet, only difference is the tag is jsp-file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How would you override the jspInit() method?

A

Make sure to use a declaration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly