MT Sample Questions Flashcards

1
Q

The basic protocol that drives the web is:

A

HTTP

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

Java EE deployment descriptors are described and stored in what format?

A

XML (web.xml)

Determine how application is deployed

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

Which of the following is in JSF but not in JSP or Servlets:
- Navigation
- Session management
- Error handling
- Extensible tag mechanism

A

Navigation

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

The primary JSF configuration file is

A

faces-config.xml

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

Which CDI scope requires stored objects to be thread safe?

A

Session scope?

Yes, because multiple access for a single session (thread-safe means safe concurrent action)

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

Which CDI scope exists from the time an HTTP request is sent until the response is sent back to the client?

A

Request-scoped

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

Which JSF tag generates an HTTP GET request?A)h:commandButton
B)h:doGet
C)j:commandLink
D)h:link
E)h:command

A

h:link (navigates to a new page without form submission. Uses GET instead of POST)

NOTE: doGet doesn’t exist.

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

A JSF tag used to organize a page into a tabular format is

A

h:dataTable

(h:panelGrid incorrect because organizes page in a grid but does not create a “tabular” table.)

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

What JSF tag is used to add html around an HTML element?
A)ui:template
B)ui:decorate
C)ui:component
D)h:composition
E)ui:composition

A

ui:decorate

Adds your xHTML file/composition to existing HTML code by “decorating” it in.

Note: composition tag throws away everything outside of it.

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

What component is generated by h:dataTable?

A)UIData
B)UIDataTable
C)UITable
D)UIInput
E)Table

A

UIData

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

Selection criteria can be added to a n SQL query using which clause?A)WHERE
B)JOIN
C)LIKE
D)FROM
E)SELECT

A

SELECT or WHERE.
I assume WHERE because it determines specifically the selection criterias

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

Containers described in the Java EE specification include
A)Web application conta iner
B)Applet container
C)EJB application container
D)Application client container
E)All of the above

A

I assume all of the above because your java EE program is not always guaranteed to be a web app

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

One JSF predefined object (in the value expression language) which is not present in JSP Expression Language is
A)param
B)view
C)header
D)requestScope
E)cookie

A

view because JSF uses a component tree view whereas JSP just creates dynamic HTML.

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

In order for a JSF page to determine the next page to be displayed, it can use
A)next-page
B)from-outcome
C)to-view
D)from-view-id
E)from-action

A

from-view-id

It is not from-outcome because from-view-id is more foundational

For example, you can use implicit navigation without a from-outcome.

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

Which JSF HTML tag attribute is used to link its component with a backing bean property?A)value
B)binding
C)property
D)backing
E)id

A

value 100%

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

Which tag is used to specify a JSF template section that can be filled with content by a page using that template?A)ui:composition
B)ui:content
C)f:include
D)ui:insert
E)ui:include

A

ui:insert

Because insert is a placeholder within that page that can be filled with content.

ui:composition on the other hand is the template

17
Q

What JSF standard tag is used to create a repeating grid of data?
A)h:tableGrid
B)h:dataGrid
C)h:repeat
D)h:dataTable
E)c:choice

A

h:dataTable

NOTE: dataGrid does not exist.

NOTE: dataTable creates “repeating grid” by iterating over a collection defined in “value” attribute. Elements represented by “var” attribute

18
Q

Before executing:
con = DriverManager.getConnection(“jdbc:mysql://localhost/inventory”,user,pass);

You would have to:
A)load the JDBC-ODBC bridge driver
B)load a da ta bas e driver
C)load the ODBC driver
D)load the JDBC driver
E)download and install a nonstandard driver

A

Load a database driver
(Software component that allows application to use DBMS)

19
Q

Which of the following distinguishes Enterprise Java development from standard Java development?
A)object serialization
B)multiple threads
C)the Java plug-in
D)web servers
E)application servers

A

Application servers (Wildfly/JBoss)

20
Q

Sockets are generally preferred over RMI or CORBA since they are usually more efficient.

A

True

RMI is remote method invocation

CORBA enables communication between components on multiple platforms

Sockets are lightweight + low overhead (Think of C project).

21
Q

A JSF application is typically deployed as a WAR file

22
Q

A managed bean in JSF can be stored in a specified scope, as defined in a configuration file.

A

True, although the scope is normally annotated.

23
Q

Since JSF 2.0, the navigation rule to view-id-element can be a value expression which is evaluated at navigation time to return the view ID

A

True, you can use an EL expression for dynamic navigation.

24
Q

When a value expression is used directly in a JSF page the value is always escaped (<changed to < and so forth)

A

False

Special characters in the value are escaped to prevent scripting attacks.

However, it is not always escaped.

25
What are two categories of enterprise user interfacing?
Internal enterprise user interfacing External enterprise user interfacing OR Web presentation (html, css, js) Application presentation (standalone app interface)
26
What does CDI stand for?
Contexts and Dependency Injection
27
What steps are taken when the user clicks a JSF command button whose action attribute is a method expression?
A faces request triggers the lifecycle: Restore view Apply requests Process validations Update model values Invoke application Render response (NOTE: initial requests go straight to render response)
28
What JSF tag adds a debug component to the page which can display the state of the component tree and the application's scoped variables?
ui:debug
29
Advantages and disadvantages of using Java for EE development?
+ Platform independence + Robustness (type checking + OOP) + Rich ecosystem and support - Learning curve - Performance overhead - Memory/resources consumption
30
Which version of Jakarta EE?
10
31
Which is in JSF but not in Struts, JSP, and Servlets? a) UI Component Model b) Declarative backing beans integration c) Server-side UI Events d) Automatic markup generation e) All of the above
E