MT Sample Questions Flashcards
The basic protocol that drives the web is:
HTTP
Java EE deployment descriptors are described and stored in what format?
XML (web.xml)
Determine how application is deployed
Which of the following is in JSF but not in JSP or Servlets:
- Navigation
- Session management
- Error handling
- Extensible tag mechanism
Navigation
The primary JSF configuration file is
faces-config.xml
Which CDI scope requires stored objects to be thread safe?
Session scope?
Yes, because multiple access for a single session (thread-safe means safe concurrent action)
Which CDI scope exists from the time an HTTP request is sent until the response is sent back to the client?
Request-scoped
Which JSF tag generates an HTTP GET request?A)h:commandButton
B)h:doGet
C)j:commandLink
D)h:link
E)h:command
h:link (navigates to a new page without form submission. Uses GET instead of POST)
NOTE: doGet doesn’t exist.
A JSF tag used to organize a page into a tabular format is
h:dataTable
(h:panelGrid incorrect because organizes page in a grid but does not create a “tabular” table.)
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
ui:decorate
Adds your xHTML file/composition to existing HTML code by “decorating” it in.
Note: composition tag throws away everything outside of it.
What component is generated by h:dataTable?
A)UIData
B)UIDataTable
C)UITable
D)UIInput
E)Table
UIData
Selection criteria can be added to a n SQL query using which clause?A)WHERE
B)JOIN
C)LIKE
D)FROM
E)SELECT
SELECT or WHERE.
I assume WHERE because it determines specifically the selection criterias
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
I assume all of the above because your java EE program is not always guaranteed to be a web app
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
view because JSF uses a component tree view whereas JSP just creates dynamic HTML.
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
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.
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
value 100%
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
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
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
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
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
Load a database driver
(Software component that allows application to use DBMS)
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
Application servers (Wildfly/JBoss)
Sockets are generally preferred over RMI or CORBA since they are usually more efficient.
True
RMI is remote method invocation
CORBA enables communication between components on multiple platforms
Sockets are lightweight + low overhead (Think of C project).
A JSF application is typically deployed as a WAR file
True
A managed bean in JSF can be stored in a specified scope, as defined in a configuration file.
True, although the scope is normally annotated.
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
True, you can use an EL expression for dynamic navigation.
When a value expression is used directly in a JSF page the value is always escaped (<changed to < and so forth)
False
Special characters in the value are escaped to prevent scripting attacks.
However, it is not always escaped.
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)
What does CDI stand for?
Contexts and Dependency Injection
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)
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
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
Which version of Jakarta EE?
10
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