Course: Advanced Java Programming (APT TEMPLATE)

Q: Many-to-many relationships between tables are usually established using two tables and a linking table<span style="font-size:12pt">.</span>
- True
- False
A: True

Q: A default class is installed in a default package when web applications are installed.
- True
- False
A: False

Q: The doPost() method of a servlet will also process GET requests if a doGet() method is not specified.
- True
- False
A: False

Q: Some JSF controls can not only serve as submit buttons but can only be bound to component data or functionality.
- True
- False
A: True

Q: JSF tags are processed by the servlet container and sent back to the browser as standard JavaScript and CSS.
- True
- False
A: False

Q: Data access specifiers must be set to public to enable JSF input control binding.
- True
- False
A: False

Q: The h:outputStylesheet designates a CSS style sheet to use.
- True
- False
A: True

Q: When creating a main template in NetBeans, you have a choice between CSS and Table for layout style selections.
- True
- False
A: True

Q: Referential integrity helps ensure data types are used consistently in tables related by primary and foreign keys.
- True
- False
A: False

Q: The Connector/J driver used by Java code to connect with MySQL is a Type 4 JDBC driver.
- True
- False
A: True

Q: What are two common web server and servlet container combinations?
- Glassfish/Tomcat
- Blowfish/Tomcat
- Tomcat/Apache
- Jakarta/Apache
A: Glassfish/Tomcat

Q: The JDK contains:
- URL resolution protocols
- public and private JREs
- redirection utilities
- presentation implementation tiers
A: public and private JREs

Q: The default port for servlet containers is:
- 4848
- 8888
- 8080
- 2121
A: 8080

Q: For web applications, NetBeans places the _____ file in the _____ folder.
- .jar/web
- .jar/project
- .war/pub
- .war/dist
A: .war/dist

Q: It is convention to name Java packages:
- in reverse URL order
- with camel case
- by including the project name
- with the same name as the class file
A: in reverse URL order

Q: Which of the following is also known as the deployment descriptor?
- tags.xml
- web.xml
- jsfdd.xml
- app-context.xml
A: web.xml

Q: What is the renaming process called that NetBeans uses to help ensure name changes apply internally to files?
- redirecting
- reconfiguring
- refactoring
- reinstantiating
A: refactoring

Q: The @WebServlet annotation alleviates the need to register a servlet in the following file _____.
- dist-config.xml
- web-config.xml
- faces.xml
- web.xml
A: web.xml

Q: Which of the following is NOT a JSF basic tag?
- h:inputButton
- h:selectManyCheckbox
- h:commandButton
- h:inputTextArea
A: h:inputButton

Q: Namespaces are used to _____.
- parse  most xml files
- avoid name collisions
- synchronize local variables
- provide file access
A: avoid name collisions

Q: EL (Expression Language) provides _____.
- the means to relegate control to the servlet container
- synchronization between config files and their backing beans
- the communication link between UI components and their corresponding application logic
- the UI to database connection protocols
A: the communication link between UI components and their corresponding application logic

Q: Which of the following performs the role of the HTML form tag?
- h:formServlet
- h:formInput
- h:formProcessor
- h:form
A: h:form

Q: Which of the following attribute of the h:link tag defines the link’s destination?
- outcome
- href
- url
- action
A: outcome

Q: If an id attribute is not set for a JSF tag, the servlet container will _____.
- generate an error
- provide an automatically generated id
- do nothing
- use the id of the parent tag
A: provide an automatically generated id

Q: Which of the following is the url-pattern specified for JSF by default in web.xml?
- /faces-servlet/*
- /jsf-faces/*
- /faces/*
- /xhtml/*
A: /faces/*

Q: The ui:insert tag is _____.
- used in both main and client templates to reserve sections
- used to identity css styles to insert
- used in the client template to insert content
- used in the main template to designate insertion areas
A: used in the main template to designate insertion areas

Q: When creating a JSF template project, which folder structure is automatically created by NetBeans to contain CSS content?
- resources/css
- layout/css
- template/css
- library/css
A: resources/css

Q: The ui:define tag is _____.
- used by the main template to define an area for insertion
- used by the client template to define an area for insertion
- used by both the main and client templates to allocate resources
- used by both the main and client templates to define tag libraries
A: used by the client template to define an area for insertion

Q: The PrimeFaces component suite uses which of the following libraries?
- Hibernate
- Spring
- jQuery
- FacesFrame
A: jQuery

Q: A Java bean is a class that meets the following three criteria:
- serializeable, a public no-argument constructor, private getters and setters
- serializeable, a private no-argument constructor, private getters and setters
- serializeable, a private no-argument constructor, public getters and setters
- serializeable, a public no-argument constructor, public getters and setters
A: serializeable, a public no-argument constructor, public getters and setters

Q: <span style="font-size:12pt">A Java bean is considered a managed bean if it </span>_____.
- is <span style="font-size:12pt">registered with and managed by the JSF framework</span>
- is used by the UI controlled by JSF
- uses CSS to manage the page layout
- manages UI components and interactions with other beans
A: is <span style="font-size:12pt">registered with and managed by the JSF framework</span>

Q: If a Java bean is defined as @RequestScoped, when is the bean destroyed?
- when the web application closes
- when the HTTP response is complete
- when the user clicks a control
- when the database answers the HTTP request
A: when the HTTP response is complete

Q: <span style="font-size:12pt">CDI (Context Dependency Injection) annotations should be used instead of which of the following annotation?</span>
- @Named
- @ApplicationScoped
- @ManagedBean
- @Dependent
A: @ManagedBean

Q: In the JSF-JDBC application, each of the CRUD beans performed the role of a(n) _____.
- interface
- UI navigator
- manipulator
- controller
A: controller

Q: In the JSF-JDBC application, the person bean performed the role of a(n) _____.
- model
- interface
- controller
- view
A: model

Q: Why are multiple forms included on a JSF view page?
- to manage program flow more efficiently
- since h:commandButtons submit name:value pairs for all controls on the form
- to upload content to the database
- to control the interface with the managed bean
A: since h:commandButtons submit name:value pairs for all controls on the form

Q: With <span style="font-size:12pt">CDI (Context Dependency Injection), for a resource to be injected, it must be</span>_____.
- precompiled by the web server
- marked as a servlet in web.xml
- registered with a servlet container
- included in the header file
A: registered with a servlet container

Q: In Spring-MVC, which of the following performs the role of front controller?
- ServletContainer
- RoutingContainer
- DataModeler
- DispatcherServlet
A: DispatcherServlet

Q: In Spring-MVC, which of the following is used to determine the URL appendix for a controller?
- @RequestMapping
- @Controller
- @Dispatcher
- @ModelMap
A: @RequestMapping

Q: Your local Glassfish administration utility can be accessed using the following URL.
- localhost:8080
- localhost:4848
- localhost:2121
- localhost:2828
A: localhost:4848