Package org.zkoss.zk.au.http

## Class AuDynaMediar

- java.lang.Object
- - org.zkoss.zk.au.http.AuDynaMediar

- All Implemented Interfaces:
    `AuExtension`

      public class AuDynaMediar
      extends java.lang.Object
      implements AuExtension

  The AU processor used to response the content for `DynamicMedia.getMedia(java.lang.String)`
  Since:
    3.0.2
  Author:
    tomyeh

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AuDynaMediar()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.Object` | `charsetSetup​(Session session, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` | Sets the charset of the response.
    `void` | `destroy()` | Destroys the AU extension.
    `void` | `init​(DHtmlUpdateServlet servlet)` | Initializes the AU extension.
    `void` | `service​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String pi)` | Retrieves the media from `DynamicMedia.getMedia(java.lang.String)`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AuDynaMediar

          public AuDynaMediar()

  - ### Method Detail

    - #### init

          public void init​(DHtmlUpdateServlet servlet)

      Description copied from interface: `AuExtension`
      Initializes the AU extension. It is called when an extension is added to `DHtmlUpdateServlet`.
      Specified by:
        `init` in interface `AuExtension`

    - #### destroy

          public void destroy()

      Description copied from interface: `AuExtension`
      Destroys the AU extension. It is called when an extension is removed from `DHtmlUpdateServlet`, or when `DHtmlUpdateServlet` is being destroyed.
      Specified by:
        `destroy` in interface `AuExtension`

    - #### charsetSetup

          public java.lang.Object charsetSetup​(Session session,
                                               javax.servlet.http.HttpServletRequest request,
                                               javax.servlet.http.HttpServletResponse response)

      Description copied from interface: `AuExtension`
      Sets the charset of the response.
      Specified by:
        `charsetSetup` in interface `AuExtension`
      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(javax.servlet.ServletRequest, java.lang.Object)` or `Charsets.cleanup(javax.servlet.ServletRequest, java.lang.Object)` (can be null).

    - #### service

          public void service​(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response,
                              java.lang.String pi)
                       throws javax.servlet.ServletException,
                              java.io.IOException

      Retrieves the media from `DynamicMedia.getMedia(java.lang.String)`.
      Specified by:
        `service` in interface `AuExtension`
      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:
        `javax.servlet.ServletException`
        `java.io.IOException`