Interface StatelessRichlet

All Superinterfaces:
Richlet, Serializable

public interface StatelessRichlet extends Richlet, Serializable
A state less richlet interface to construct an immutable component tree to the given view.

An action request runs a method of this richlet only if an action bound to that method has been rendered in the same session. That is not access control: once rendered, the method stays callable in the session after its widget is removed or the user loses the right to use it, and its arguments come from the client. Check the user's permission and validate the arguments in every action method.

The rendered actions are kept in the HTTP session, so the client must send the session cookie back: an action request from a new session reloads the page instead. A page embedded in a cross-site iframe therefore needs a session cookie with SameSite=None; Secure, and a cluster needs sticky sessions or session replication.

Author:
jumperchen
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Called by the richlet container to indicate to a richlet that the richlet is being taken out of service.
    Returns the default language definition that this richlet belongs to.
    default void
    init(RichletConfig richletConfig)
    Called by the richlet container to indicate to a richlet that the richlet is being placed into service.
    default void
    service(Page page)
    Called by the richlet container to create components when the specified page is visited and created.
  • Method Details

    • init

      default void init(RichletConfig richletConfig)
      Description copied from interface: Richlet
      Called by the richlet container to indicate to a richlet that the richlet is being placed into service.
      Specified by:
      init in interface Richlet
    • destroy

      default void destroy()
      Description copied from interface: Richlet
      Called by the richlet container to indicate to a richlet that the richlet is being taken out of service.
      Specified by:
      destroy in interface Richlet
    • service

      default void service(Page page) throws Exception
      Description copied from interface: Richlet
      Called by the richlet container to create components when the specified page is visited and created.
      Specified by:
      service in interface Richlet
      Throws:
      Exception
    • getLanguageDefinition

      default LanguageDefinition getLanguageDefinition()
      Description copied from interface: Richlet
      Returns the default language definition that this richlet belongs to. Don't return null.

      The default language definition is used to initialize a page when the page is created to be served by this richlet. Note: you can use components from different languages as long as they belong to the same device type (LanguageDefinition.getDeviceType().

      The default language definition controls the URIs used to render a desktop and a page, and the initial zscript codes used to initialize the interpreter (of a page).

      For example, you can return

      LanguageDefinition.lookup("xul/html");
      Specified by:
      getLanguageDefinition in interface Richlet