Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Apache Tapestry Interview Questions and Answers

Ques 6. How to alter the URL to point to the correct page?

You would need to throw a RedirectException with the new URL; this sends an HTTP redirect to the client.

Is it helpful? Add Comment View Comments

Ques 7. How should do page navigation in apache tapestry?

Usage page properties:
<page-specification class="Welcome.Action">
        <property name="success" value="Home" />
        <property name="error" value="Error" />
<page-specification class="Welcome.Action">
        <property name="success" value="Home2" />
        <property name="error" value="Error2" />
public void submitListener(IRequestCycle cycle)
    if (success)
    if (error)

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

Is it helpful? Add Comment View Comments

Ques 8. How do I make a link popup a new window?

Use the contrib:PopupLink component.

Is it helpful? Add Comment View Comments

Ques 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)
        HttpServletResponse response =

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

          "inline; filename=" +
        response.setContentLength(new Long(document.getSize()).intValue());
        ServletOutputStream out = response.getOutputStream();

        while ( > -1)
    catch (IOException e)

Is it helpful? Add Comment View Comments

Most helpful rated by users:

©2024 WithoutBook