Interface AuExtension

All Known Implementing Classes:
AuDynaMediar, AuRedirect

public interface AuExtension
An AU service is a small Java program that can be plugged into DHtmlUpdateServlet to extend its functionality. An AU processor is associated with a prefix when plugged into the update servlet. Then, when a request with the prefix is received, the corresponding AU process is invoked to handle the request).
Since:
5.0.0
Author:
tomyeh
  • Method Summary

    Modifier and Type
    Method
    Description
    default Object
    charsetSetup(Session session, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
    Sets the charset of the response.
    void
    Destroys the AU extension.
    void
    Initializes the AU extension.
    void
    service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String pi)
    Called by ZK to process the AU request.
  • Method Details

    • init

      void init(DHtmlUpdateServlet servlet) throws jakarta.servlet.ServletException
      Initializes the AU extension. It is called when an extension is added to DHtmlUpdateServlet.
      Throws:
      jakarta.servlet.ServletException
    • destroy

      void destroy()
      Destroys the AU extension. It is called when an extension is removed from DHtmlUpdateServlet, or when DHtmlUpdateServlet is being destroyed.
    • service

      void service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String pi) throws jakarta.servlet.ServletException, IOException
      Called by ZK to process the AU request.

      To retrieve the http session, use HttpServletRequest.getSession(). To retrieve the ZK session, use Sessions.getCurrent(boolean).

      Parameters:
      request - the request (never null).
      response - the response (never null).
      pi - the path info. It includes the prefix when the Au processor is associated (see DHtmlUpdateServlet.addAuExtension(org.zkoss.zk.ui.WebApp, java.lang.String, org.zkoss.zk.au.http.AuExtension). For example, if an AU processor is associated with "/upload", then pi must start with "/upload". Note: it might end with other string depending on the URI you generated to the client.
      Throws:
      jakarta.servlet.ServletException
      IOException
    • charsetSetup

      default Object charsetSetup(Session session, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Sets the charset of the response.
      Parameters:
      session - ZK session (might be null).
      request - the request (never null).
      response - the response (never null).
      Returns:
      an object that must be passed to I18Ns.cleanup(jakarta.servlet.ServletRequest, java.lang.Object) or Charsets.cleanup(jakarta.servlet.ServletRequest, java.lang.Object) (can be null).
      Since:
      9.5.1