Web Tier Technologies Questions

Start course
Overview
Difficulty
Intermediate
Duration
1h 8m
Students
3
Description

This course takes an in-depth look at Java API for RESTful Web Services, otherwise known as JAX-RS. We also run through some example exam questions that will be useful for anyone who wants to take Oracle's Java EE exam.

Learning Objectives

  • Understand the fundamentals of JAX-RS
  • Learn about the main concepts and components of JAX-RS

Intended Audience

This course is intended for anyone who already has basic knowledge of Java and now wants to learn about Java EE 6.

Prerequisites

Basic knowledge of Java programming.

Transcript

Hi. Now we have finished Web Tier Technologies topic. Now, we will start to solve some questions about this topic to make more practice. Let's begin with the first question. One. Which of the options is true about the client tier?

A, the client tier cannot store the state using JPA, or a database. B, security constraints make it impossible to store state. C, the client layer can store the state with cookies. D, the client layer can maintain the state via URL rewrite. Answer C, D. Two. Which of the options are true. A, URL rewrite can only store enough state to connect a browser to a particular client session. B, you can hold state on the presentation tier with the HttpSession object. C, the use of cookies imposes a limit on the number of concurrent clients. D, each cookie can hold up to 1024 bytes of memory. Answer, A, B, C.

Three. How can a session in the application be notified when an HttpSession object has been added or removed from the session. A, through the javax.servlet.http.HttpSessionActivationListener interface. B, through the javax.servlet.http.HttpSessionRemovalListener interface. C, through the javax.servlet.http.HttpSessionBindingListener interface. D, through the javax.servlet.http.HttpSessionAdditionalListener interface. Answer, C. Four. If the client turns off cookies and your application is using session objects at the same time, which of the following options should be used for session tracking to be performed correctly? A, calling the responses encodeURL(URL) method on all URLs returned by a servlet. B, including the session ID in the URL. C, invoking the isRequestedSessionFromCookie() method of HttpServletRequest. D, invoking the isRequestedCookieFromSession() method of HttpServletRequest. Answer A, B, C. Five. Which of the following options is a potential security risk of URL rewriting?

A, users can copy and paste the attached session ID. B, the cookie may be compromised and the customer's machine may be broken. C, server log files may record the refer header, which will record session IDs in the log. D, the session ID appears in the URL. Answer, A, C, D. Six. You can maintain state with stateful session beans or entity classes. A, true. B, false. Answer, A. Seven. Which of the following options is not considered one of the main responsibilities of the web layer? A, delegating service requests to the business tier. B, handling database updates. C, dispatching presentation to the client interface. D, managing access to content. Answer, B. Eight. Which of the following options cannot be considered as one of the attributes of a servlet? A, it can be written using JavaScript. B, it's a java program that runs on a Java EE or server. C, the output format for servlets is exclusively HTML. D, it can access a relational database. Answer A, C. Nine. 

Which of the following options is not considered one of the attributes of a JSP. A, it can be written using JavaScript. B, the output format for servlets is exclusively HTML. C, it can access a relational database. D, it compiles to Java program that runs on a Java EE or server. Answer, B. 10. Which of the following options cannot be considered one of the attributes of a JSF? A, JSPs are the JSF view layer in Java EE 6. B, a JSF can access a relational database. C, JSF combines the functionality of a JSP with a built in controller. D, JSF implements the Model View Controller (MVC) framework. Answer, A. Which of the following options are the tasks of the MVC Controller? A, sending service requests to the model. B, performing business logic. C, accessing the database. D, sending views to the end user. Answer, A, D. 12. Which of the following options is among the duties of the Controller/ServiceDispatcher? A, invokes the appropriate domain model component in the business layer. B, sending views to the end user. C, the service distributor passes the business logic requests to the available business agent model. 

D, the appropriate scope persists in the value object returned from the delegated job. Answer A, C, D. 13. Which of the following options is among the duties of the Controller/ViewDispatcher? A, the view sender decides which view component to send to the end user based on the resulting condition of the user's request. B, accesses the value object as the appropriate scope and creates the final view for the user. C, sending views to the end user. D, the appropriate scope persists in the value object returned from the delegated job. Answer A, B, C. 14. Which of the following options are the benefits of the EJB container? A, it makes it easy to send views to the end user. B, because enterprise cores are loosely coupled and portable components, the application assembler can build new applications from existing cores. 

C, the EJB container provides enterprise cores with non useful services such as transaction management. D, Because the beans rather than the clients contain the application's business logic, the client developer can focus on the presentation of the client. Answer, B, C, D. 15. In Java EE 6, EJBs can be called asynchronously. A, true. B, false. Answer, A. 16. How do you get a reference to a corporate bean reference? A, JDBC look up. B, JNDI look up. C, dependency injection. D, LDAP look up. Answer, B, C. 17. Which of the following features should a local customer have when accessing the enterprise bean? A, it should run in the same application as the enterprise bean is accessing. B, can be a web component or other enterprise bean. C, for the local client, the location of the corporate bean it is accessing is not transparent. D, it cannot be a web service. Answer A, B, C. 18. Which of the following features should the remote client have when accessing the enterprise bean? 

A, it may run on a different machine and a different JBM than the enterprise bean it is accessing. B, the enterprise bean must implement a business interface, that is, remote clients may not access an enterprise bean through a no interface view. C, it can be a web component, an application client or some other enterprises bean. D, it cannot be a web component or any other enterprise bean. Answer, A, B, C. 19, which of the following options is correct when a web service client accesses a Java EE application? A, the enterprise bean must implement a business interface, that is, remote clients may not access an enterprise bean through a no-interface view. B, message beans are not accessible by web service clients. C, the client can access a web service created with JAXWS. D, a web service client can call the business methods of a stateless session bean.

Answer, A, C, D. 20, Regarding the Java EE session core, which of the following statements is true? A, for a stateless session bean (SLSB), the interaction is contained in a single method call, and the process does not maintain the client state. B, a singleton session bean is initialized once per application and exists for the lifetime of the application. C, message session beans are not accessible by web service clients. D, for a stateful session bean (SFSB), the interaction may invoke many methods and processes can span multiple method requests, thus necessitating the maintaining of a client state. Answer, A, B, D. 21, regarding Java EE single session cores, which of the following options can considered correct? A, a single session is initiated only once per application. B, a singleton session bean exists for the life cycle of the application. C, a singleton session bean must be initialized on application startup. D, a singleton session bean exists in a pool of beans? Answer A, B, D. 22, regarding Java EE stateful session cores, which of the following options is considered true? A, stateful session beans are appropriate if a bean represents state.

B, stateful session kernels are available for the lifetime of the application. C, stateful session beans manage the workflow of the various enterprise beans for the customer. D, stateful session beans improve performance. Answer, A, C. 23, regarding message oriented kernels MDBs, which of the following options is correct? A, MDBs are stateless EJBs that asynchronously consume JMS messages. B, MDBs asynchronously consume JMS messages. C, MDBs are invoked directly by the client. D, MDBs exist for the lifetime of the application. Answer, A, B. 24, which of the following options is correct regarding server sending and client pulling? A, in client pull, an HTTP connection is kept open.

B, with server push, the browser displays the data and leaves the connection open. C, message session beans are not accessible by web service clients. D, in a client pull the mechanism may include a command that can set a timer during which time it will execute a call to the server for new data. Answer, B, D. 25, regarding browser access to server based asynchronous processes, which statements are true? A, with the idea of server push, the browser displays the data and leaves the connection open. B, with the idea of server push, the server sends new data synchronously. C, the way browsers present asynchronous programming to application logic is by events or callbacks. D, browsers provide a number of asynchronous APIs, such as the commonly used XHR (XMLHttpRequests or "Ajax") APIs, as well as IndexedDb,SQLite and HTML5, to name a few. Answer, A, C, D.

 

About the Author
Students
1180
Courses
63
Learning Paths
4

OAK Academy is made up of tech experts who have been in the sector for years and years and are deeply rooted in the tech world. They specialize in critical areas like cybersecurity, coding, IT, game development, app monetization, and mobile development.

Covered Topics