300+ TOP Apache TAPESTRY Interview Questions and Answers

Apache Tapestry Interview Questions for freshers experienced :-

1. What is Apache Tapestry?
It is an open source web framework written in Java and can work under any application server. It is easily integrate with back ends like Hibernate and Spring etc. It is a component based web framework.

2. What are the benefits of Apache Tapestry?
Benefits of Apache Tapestry are:

  • Adaptive API
  • Fast framework
  • Build-in Inversion Control
  • Highly scalable web applications
  • Storage management of Persistent state

3. What are the features of Apache Tapestry?
Features of Apache Tapestry are:

  • Live class reloading
  • Code less, deliver more
  • Static structure and dynamic behavior
  • Detailed and clear exception reporting
  • Extensive use of POJOs (Plain Old Java Objects)

4. Who is the developer of Apache tapestry?
Apache Tapestry is developed by “Howard Lewis Ship”.

5. What is the component annotations used in Apache Tapestry?
Component annotations used in Apache Tapestry are:

  1. @Log
  2. @Path
  3. @import
  4. @Property
  5. @Parameter
  6. @Environmental

6. What is IoC annotation?
IoC annotation: It is used to inject objects into IoC Container.

Type of IoC annotation are:

  1. @Value
  2. @Inject

7. What is CleanupRender?
CleanupRender: It is used to release the objects created during rendering process. It is the counterpart of the SetupRender.

8. What is Two-way Data Binding?
In Two-way data binding, we can communicate and transfer data with the use of parameters, components and its corresponding page.

9. What is Validate expansion?
Validate expansion: It is a specialized string that is used to specify the validation rule of an object.

10. What is Form Component?
It is used to create a form in the tapestry page for user input. A form can contain text fields, checkbox fields, date fields, submit button, select options and more.

Apache TAPESTRY Interview Questions
Apache TAPESTRY Interview Questions

11. Does Apache Tapestry use JSP Tag libraries?
No, It does not use JSP Tag library.

  300+ [LATEST] Apache Tapestry Interview Questions and Answers

12. What is TextField Component?
TextField Component: It is used to edit a single line of text.

13. What are the significant parameters used in Form Validation?
Significant parameters used in Form Validation are:

  • Min
  • Max
  • Email
  • MaxDate
  • MaxLength
  • MinLength

14. What are the ways provided by Apache Tapestry to persist the data?
There are two ways provided by Apache Tapestry to persist the data are:

  1. Session Storage
  2. Persistence page data

15. What is SSO?
SSO stands for Session Store Object. It is a specialized store that is used to store complex / special object. Data types can also be stored using SSO.

16. Why Do We Need @script In Apache Tapestry?
The script framework is an effective means to bundle scripts in components. It provides scripts with the advantages of components. It can now be reused like a component and not have to worry about renaming field names or the wiring between the fields and the scripts. You just declare the component and you are good to go. It certainly is another layer of abstraction that one will have to learn but once you have learned it, it is very powerful. And honestly there is not much to it.

The script framework is mandated by the fact that form element/field names are automatically generated by the framework. And so you write your script in XML and use variables for these names and let the framework provide the correct names during runtime. Going further, you may also ask the framework to provide other objects that would help in creating your script. For example…

<input-symbol key=”select”
class=”org.apache.tapestry.form.PropertySelection”
required=”yes”/>

This defines an input variable “select” of type “org.apache.tapestry.form.PropertySelection”. All such variables/symbols passed in to the script is stored in a symbol map. And now you can use the form select list name by using an ant style syntax like ${select.name}. The expression within “${}” is an OGNL expression and is evaluated with respect to the symbol map. You may also define your own symbols/variables using <let…> like…

  300+ [LATEST] Apache Tapestry Interview Questions and Answers

<let key=”formObj”>
document.${select.form.name}
</let>
<let key=”selectObj”>
${formObj}.${select.name}
</let>

These variables/symbols are stored in the symbol map also. So now if you want to set the value of the form select list all you do is say ${formObj}.${selectObj}.value = ‘whatever’; this would be equivalent to document.myForm.mySelect.value = ‘whatever’; where myForm is the form name and mySelect is the select list name.

<input-symbol…>s are like method parameters and <let…>s are like instance variables. Typically you would pass values to the <input-symbol…>s via the Script component like…

<component id=”myScript” type=”Script”>
<static-binding name=”script” value=”ScriptSpecificationName.script”/>
<binding name=”select” expression=”components.somePropertySelection”/>
</component>

The actual scripts are defined in one of the two sections of the script specification, <body…> or <initialization…>, depending on when you want the script to execute. If you want the script to execute on load of the page, then you define it in the <initialization…>, if you want it to execute on any other event, define it in the <body…> section of the specification. For example…

<body>
function onChangeList(listObj)
{
alert(listObj.value);
}
</body>
<initialization>
${selectObj}.onchange = function(e)
{
onChangeList(${selectObj});
}
</initialization>
As you can see in the rendered page all scripts are aggregated at the top of the page body, there are no more scripts all over the page. Even event handlers are attached to form objects in the initialization block.

One more thing to remember, scripts being components, and components by nature being independent of its environment, will render the script in the page once for every ocurrance of the component. If you want the body of the script to be rendered only once no matter how many times the component is used, just wrap the body in a <unique> tag like…

  300+ [LATEST] Apache Tapestry Interview Questions and Answers

<body>
<unique>
function onChangeList(listObj)
{
alert(listObj.value);
}
</unique>
</body>

17. What’s The Lifecycle Of A Form Submit?

Events will trigger in the following order:

initialize()
pageBeginRender()
formListenerMethod()
pageBeginRender()

The form “rewind” cycle is nothing more than a render cycle where the output is buffered and scrapped rather than written to the servlet output stream. The second pageBeginRender() is triggered during the actual page rendering. You can use requestCycle.isRewinding() to distinguish between these two render cycles.

18. Can I Use The Same Component Multiple Times In One Template?

No – but you can copy the definition of a component pretty easily.

<component id=”valueInsert” type=”Insert” >
<binding name=”value” expression=”getValueAt( rowIndex, columnIndex )” />
</component>

<component id=”valueInsert1″ copy-of=”valueInsert”/>
<component id=”valueInsert2″ copy-of=”valueInsert”/>
<component id=”valueInsert3″ copy-of=”valueInsert”/>
<component id=”valueInsert4″ copy-of=”valueInsert”/>

19. How Should Do Page Navigation In Apache Tapestry?

Usage page properties:

Page1.page
<page-specification class=”Welcome.Action”>
<property name=”success” value=”Home” />
<property name=”error” value=”Error” />
</page-specification>

Page2.page
<page-specification class=”Welcome.Action”>
<property name=”success” value=”Home2″ />
<property name=”error” value=”Error2″ />
</page-specification>

Welcome.Action.java
public void submitListener(IRequestCycle cycle)
{
if (success)
cycle.activate(getSpecification().getProperty(“success”));
if (error)
cycle.activate(getSpecification().getProperty(“error”));
}

So on success, it will be redirected to Home2 and on error it will be redirected to Error2 page.

20. Is Tapestry A Jsp Tag Library?

Tapestry is not a JSP tag library; Tapestry builds on the servlet API, but doesn’t use JSPs in any way. It uses it own HTML template format and its own rendering engine. Starting with release 3.0, Tapestry includes a simple JSP tag library to allow JSP pages to create links to Tapestry pages.

Apache TAPESTRY Questions and Answers Pdf Download

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top