Lecture 2A Flashcards

1
Q

What are scoped variables?

A

For storing and sharing data in server memory. Across an entire session instead of surrounding method (doPost() doGet()). Data objects put in scope (a map) in main memory.

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

How long does session last?

A

Until user closes browser or server is stopped.

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

What are the two main methods to create and access scoped variables?

A

Scope.setAttribute() and scope.getAttribute()

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

Code for using sessions scoped variable:

A

Request.getSession().setAttribute(name, value);

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

JSP? JSF?

A

Java Server Pages, Java Server Faces. JSPs are translated into servlets at runtime. Like HTML pages which contain Java Code - scriptlets,

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

How to write scriptlets:

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

Pros of using JSP’s

A

Content and display logic seperate, automatic deployment (recompile automatically), uses javabeans, easy to do html, platform independent.

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

JSP expressions:

A

Also: Expression

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

JSP scriptlets:

A

Also: code

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

JSP declaration:

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

JSP actions:

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

Write basic import statement for servlet extras

A

Import javax.servlet.http.HttpServlet;

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