Class PreviewAction

  • All Implemented Interfaces:
    com.xpn.xwiki.internal.web.LegacyAction

    @Component
    @Named("preview")
    @Singleton
    public class PreviewAction
    extends EditAction

    Action for previewing document changes. It prepares a temporarily changed document which is placed in the context, without actually saving anything. The response is normally rendered by the preview.vm template.

    This action also works like a request dispatcher, an early work-around for the fact that in HTML a form can only have one destination URL. Thus, the form had to be submitted to one action which would further dispatch the request to other actions, based on the clicked form button. Since preview is the safest method of the possible form actions, it was chosen as the dispatcher. Currently this functionality is deprecated and maintained only for backwards compatibility with older skins, since a cleaner dispatcher was implemented in ActionFilter.

    Version:
    $Id: 5d9f9bc8fdbfda6845d5ba1031b6b05c368e259c $