Other Content

It is not uncommon for web applications to show dynamically changing images or PDF reports on screen. In order to achieve this you would need to be able to write to the HTTP response yourself and avoid Struts trying to forward to a resource.

This can be done easily, just don't model any outgoing transitions on an action state which is deferring to a controller operation. It is this controller operation which will need to take care of the HTTP response.

Notice how the action state without any outgoing transitions is deferring to a controller operation. The code you execute in this operation could look like this:

Calling this action will not forward to any resource anymore, but it will return a different content which is controlled by you. The most interesting way of calling this action is by doing something like this:

Directly calling the action from a link will result in the HTTP response being rendered in the browser window, you will probably want to edit the JSP and use a tag as shown above to have a more aesthetically pleasing result.

Next

Next up is the Internationalization section.