concept custom result in category java

appears as: custom results, custom result
Struts 2 in Action

This is an excerpt from Manning's book Struts 2 in Action.

In order to make sure you know what they are and how they work, we start by building a custom result that demonstrates a technique for developing Ajax applications on the Struts 2 platform. Seeing how the framework can easily be adapted to return nontraditional results, such as those required by Ajax clients, serves as a perfect demonstration of the flexibility of the result component. It both teaches you the internals of results and gives you an example of Struts 2 Ajax development. After that, we go on to tour the built-in results that the framework provides for your convenience. These include the default result that supports JSP pages, as well as alternative page-rendering options such as Velocity or FreeMarker templates.

8.1.1. Beyond the page: how to use custom results to build Ajax applicat- tions with Struts 2

In the rest of this section, we’re going to build a custom result that can return a response suitable for consumption by an Ajax client. This example, while focusing on an Ajax use case, is meant, first and foremost, to serve as a thorough introduction to results. But we’ve chosen Ajax as our example because we know that all new web application frameworks will have to support Ajax. In short, we feel that Struts 2 provides a strong platform for building Ajax applications, and we believe that the flexibility of the result component is a cornerstone of this strength. Thus, it’s only natural to use an Ajax example as our case study of a custom result.