Principais perguntas e respostas de entrevista e testes online
Plataforma educacional para preparacao de entrevistas, testes online, tutoriais e pratica ao vivo

Desenvolva habilidades com trilhas de aprendizado focadas, simulados e conteudo pronto para entrevistas.

WithoutBook reune perguntas de entrevista por assunto, testes praticos online, tutoriais e guias comparativos em um unico espaco de aprendizado responsivo.

Preparar entrevista

Simulados

Definir como pagina inicial

Adicionar esta pagina aos favoritos

Assinar endereco de e-mail
Inicio / Assuntos de entrevista / Apache Tapestry
Entrevistas simuladas LIVE da WithoutBook Apache Tapestry Assuntos de entrevista relacionados: 39

Interview Questions and Answers

Conheca as principais perguntas e respostas de entrevista de Apache Tapestry para iniciantes e candidatos experientes e prepare-se para entrevistas de emprego.

Total de perguntas: 9 Interview Questions and Answers

A melhor entrevista simulada ao vivo para assistir antes de uma entrevista

Conheca as principais perguntas e respostas de entrevista de Apache Tapestry para iniciantes e candidatos experientes e prepare-se para entrevistas de emprego.

Interview Questions and Answers

Pesquise uma pergunta para ver a resposta.

Perguntas e respostas de nivel iniciante / recem-formados

Pergunta 1

What is Apache Tapestry?

  • A component-based view framework.
  • Classes are written as POJOs and byte-code transformed at run time
  • Configured with annotations and naming conventions rather than XML
  • Compared to JSPs, enforces a clear separation of HTML markup and Java code.
  • HTML templates are directly previewable by web designers
  • Changed component classes are live-reloaded into running application for faster development.
  • Uses the Post/Redirect/Get navigation pattern for form submission.
Salvar para revisao

Salvar para revisao

Adicione este item aos favoritos, marque-o como dificil ou coloque-o em um conjunto de revisao.

Abrir minha biblioteca de aprendizado
Isto e util?
Adicionar comentario Ver comentarios
Pergunta 2

Does Tapestry use JSP Tag libraries?

No. Tapestry does not use JSP Tag library.
Tapestry builds on the Servlet API, but does not use JSP anyway.
It uses its own HTML template format and its own rendering engine.
Salvar para revisao

Salvar para revisao

Adicione este item aos favoritos, marque-o como dificil ou coloque-o em um conjunto de revisao.

Abrir minha biblioteca de aprendizado
Isto e util?
Adicionar comentario Ver comentarios
Pergunta 3

Is Apache Tapestry free/open source?

Yes. Tapestry is open source and free
It is licensed under the Apache Software License, which allows it to be used even inside proprietary software.
Salvar para revisao

Salvar para revisao

Adicione este item aos favoritos, marque-o como dificil ou coloque-o em um conjunto de revisao.

Abrir minha biblioteca de aprendizado
Isto e util?
Adicionar comentario Ver comentarios

Perguntas e respostas de nivel intermediario / de 1 a 5 anos de experiencia

Pergunta 5

How do we write components in Apache Tapestry?

Retrieving bound properties: When writting a component, you often require various properties to be supplied by the component user. At some point during rendering, you will want to use the value of this property.
You can do this by accessing the Binding. Assume we have a component with one property called 'values'. Our component will use this list in its preRenderCommponent() method to setup some model, for use elsewhere.

.... if(getValues() == null) {
  IBinding binding = getBindings("values"); if(binding.getObject() == null) {
      throw new RequestCycleException("The value for 'values' cannot be null", this);
  } setValues((List)values.getObject());
}

The binding itself will ensure that the object value is the correct type (assuming of course, it's been setup right).
Performing Lazy Instantiation of state based upon component properties: In some cases, the output of a component may be based upon the state of some other property of the same component. For example, imagine a form where the user can choose the type of product to view. When they choose a product, the form makes a query to the database for products matching this type, and reshows the list on the same page. (the list would be included outside of the form element itself).
Lets assume that the page object exposes it's products via a getProductModel(), which is an instance of IPropertySelectionModel.
We will also assume that the remainder of the page has the other components necessary to render correct HTML, using the value supplied by the getProductModel() result.
Here, it is helpful to know when in the rendering process you can rely on the value of selectedProduct to be set correctly, so that you can instantiate a ProductModel based on the provided value, for use in the form rendering. The best place to setup state is in the preRenderComponent() method. This is called by Tapestry just before it renders any component, but AFTER it has set component properties. So, we might write:

protected void preRenderComponent() {
  String selected = getSelectedProduct();
  List products = getMatchingProducts(selectedProduct);
  productModel = new ProductModel(products);
  .. other initialization code ...
Salvar para revisao

Salvar para revisao

Adicione este item aos favoritos, marque-o como dificil ou coloque-o em um conjunto de revisao.

Abrir minha biblioteca de aprendizado
Isto e util?
Adicionar comentario Ver comentarios

Perguntas e respostas de nivel experiente / especialista

Pergunta 6

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:

<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:

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

Salvar para revisao

Adicione este item aos favoritos, marque-o como dificil ou coloque-o em um conjunto de revisao.

Abrir minha biblioteca de aprendizado
Isto e util?
Adicionar comentario Ver comentarios
Pergunta 8

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.
Salvar para revisao

Salvar para revisao

Adicione este item aos favoritos, marque-o como dificil ou coloque-o em um conjunto de revisao.

Abrir minha biblioteca de aprendizado
Isto e util?
Adicionar comentario Ver comentarios
Pergunta 9

How to get a file from client input to server end in apache tapestry?

Make a method like the following a a listener, such as from a DirectLink or whatever.
(The Document is just a class that holds the file information you want to send to the user.)

public void downloadAction(IRequestCycle cycle)
{
    try
    {
        HttpServletResponse response =
        cycle.getRequestContext().getResponse();

        byte[] data = new byte[1024];
        FileInputStream in = document.getFileInputstream();

        response.setHeader("Content-disposition",
          "inline; filename=" +
           document.getFileName());
        response.setContentType(document.getMimeType());
        response.setContentLength(new Long(document.getSize()).intValue());
        ServletOutputStream out = response.getOutputStream();

        while (in.read(data) > -1)
        {
            out.write(data);
        }
        in.close();
        response.flushBuffer();
    }
    catch (IOException e)
    {
        e.printStackTrace();
    }
}
Salvar para revisao

Salvar para revisao

Adicione este item aos favoritos, marque-o como dificil ou coloque-o em um conjunto de revisao.

Abrir minha biblioteca de aprendizado
Isto e util?
Adicionar comentario Ver comentarios

Mais uteis segundo os usuarios:

Copyright © 2026, WithoutBook.