Sunday, 1 May 2016

ADF Interview Questions - Set 10

Question: How to run application with -Djbo.debugoutput=console enabled in JAVA options?
Answer: Right click on project -> open project properties -> Select Run/Debug/Profile option and click on Edit -> Give -Djbo.debugoutput=console  in Java Options -> Click Ok.

Question: Can you use view object inside custom component definition?
Answer: Use of datamodel inside the Declarative components is not allowed by adf. But there is work around for that you can pass you iterator to Declarative component. You have to write the logic to get data from iterator and display on component same logic you can use to retrieve data from component and set that to iterator.

Question: What is view object?
Answer: A view object is a model object used specifically in the presentation tier. It contains the data that must display in the view layer and the logic to validate user input, handle events, and interact with the business-logic tier. The backing bean is the view object in a JSF-based application. Backing bean and view object are interchangeable terms

Question: What is a view scope?
Answer: A view-state allocates a new viewScope when it enters. This scope may be referenced within the view-state to assign variables that should live for the duration of the state. This scope is useful for manipulating objects over a series of requests from the same view.

Question: What do you mean by Bean Scope?
Answer: Bean Scope typically holds beans and other objects that need to be available in the different components of a web application.

Question: Can you use view object inside custom component definition?
Answer: Use of data model inside the Declarative components is not allowed by adf. But there is work around for that you can pass you iterator to Declarative component. You have to write the logic to get data from iterator and display on component same logic you can use to retrieve data from component and set that to iterator.

Question: Which file holds the details of users and groups in adf?
Answer: Users and Groups we usually create in Security part at the time of enabling security on your application by default some of the files gets created inside Application Resources, Inside that we will find jazn-data.xml file, once we open that file we can have access to create the user profiles, Application Roles and Enterprise roles, So your application level roles is assigned to the users whomever are created in your user profile, So each and everything from user roles to enterprise roles you are giving inside your jazn-data.xml file.

Question: Explain about JSF lifecycle.
Answer: A typical JSF lifecycle flows as follows:
1.     JSF interrogates the request to extract the incoming parameters.
2.     JSF converts these parameters from strings to their corresponding data types.
3.     JSF validates the presence of required parameters, the correctness of entered values, etc.
4.     JSF uses the incoming URL to determine who should process the request. This is usually done using post-backs.
5.     JSF will execute any custom logic that you provide it. Your logic will store work products (or Transfer Objects for the view) in the appropriate scope. JSF defines interfaces for event handlers and clear guidelines as to when a particular handler will be invoked.
6.     JSF determines the view that will display the response to the user. JSF uses the return value of your application handler to look up the desired view in a mapping file that you provide.
7.     JSF will execute any custom logic that you provide to render your response, or will forward to the desired view.

During all of this, JSF provides utilities for errors to be exposed to the user, for internationalization using resource bundles, etc. JSF does not provide a native composition facility - so you'll need to include Tiles or Facelets.


Question: How to declare the page navigation (navigation rules) in faces-config.xml file in ADF 10g?
Answer: Navigation rules tells JSF implementation which page to send back to the browser after a form has been submitted. We can declare the page navigation as follows:
<naviagation-rule>
<from-view-id>/index.jsp</from-view-id>
<navigation-case>
<from-outcome>login</from-outcome>
<to-view-id>/welcome.jsp</to-view-id>
</navigation-case>
</naviagation-rule>
This declaration states that the login action navigates to /welcome.jsp, if it occurred inside /index.jsp.

Question: How to set the range of a table?
Answer: <af:table rows=”#{bindings.LoggedInUserServiceRequests.rangeSize}”…/>

Question: What is region in Task Flow?
Answer: You can render a bounded task flow in a JSF page or page fragment (.jsff) by using an ADF region. An ADF region comprises the following. You create an ADF region by dragging and dropping a bounded task flow that contains at least one view activity or one task flow call activity to the page where you want to render the ADF region. This makes sure that the ADF region you create has content to display at runtime

Question: What is Backing Bean?
Answer: Backing beans are JavaBeans components associated with UI components used in a page. Backing-bean management separates the definition of UI component objects from objects that perform application-specific processing and hold data.
Backing beans are those managed beans which have 1:1 mapping with a page. They have getters and setters for all the components in the related page.

Backing bean is about the role a particular managed bean plays. This is a role to be a server-side representation of the components located on the page. Usually, the backing beans have a request scope, but it is not a restriction.
The backing bean defines properties and handling-logics associated with the UI components used on the page. Each backing-bean property is bound to either a component instance or its value. A backing bean also defines a set of methods that perform functions for the component, such as validating the component’s data, handling events that the component fires and performing processing associated with navigation when the component activates.

No comments:

Post a Comment