Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Apache%20Tapestry%20Interview%20Questions%20and%20Answers

Question: How should do page navigation in apache tapestry?
Answer:
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.
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook