ilog.webui.dhtml

Class IlxWResourceManager

  • java.lang.Object
    • javax.servlet.GenericServlet
      • javax.servlet.http.HttpServlet
        • ilog.webui.dhtml.IlxWResourceManager
  • All Implemented Interfaces:
    ilog.webui.dhtml.IlxWConstants, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig


    public class IlxWResourceManager
    extends javax.servlet.http.HttpServlet
    implements ilog.webui.dhtml.IlxWConstants
    Resource manager servlet. The resource manager servlet is in charge of loading resources (.gif, .jpg, .js, and so on) from the client. The resource description is given as a set of request parameters which will be interpreted by the service method of this servlet.

    A resource manager servlet can be registered in your web application in order to optimize the resource loading. Actually, if no resource manager is registered in your Web application, the framework will automatically generate a URL calling the controller servlet with a set of parameters which will be forwarded to the resource manager servlet.
    To avoid this forward and reduce the size of the generated URLs, you can register your own resource manager in the deployment descriptor (WEB-INF/web.xml) of your application. For example, you may define a resource manager servlet and put it in the /classes of your web application.

       package mypackage;
       public class MyResourceManager extends IlxWResourceManager {
         // do nothing, simply redefine the servlet so that it is loaded
         // by the class loader of the Web Application.
         // Actually with some web servers, a servlet must always be a part of
         // the classes of the web application.
       }
     
    And then, you will add the following lines to your web.xml file:
     <context-param>
       <param-name>ilog.webui.dhtml.resource_manager_path</param-name>
       <param-value>/_res</param-value>
     </context-param>
     ...
     <servlet>
       <servlet-name>MyResourceManager</servlet-name>
       <display-name>MyResourceManager</display-name>
       <description>Resource manager servlet</description>
       <servlet-class>mypackage.MyResourceManager</servlet-class>
     </servlet>
     ...
     <servlet-mapping>
      <servlet-name>MyResourceManager</servlet-name>
      <url-pattern>/_res/*</url-pattern>
     </servlet-mapping>
     

    See Also:
    IlxWController, Serialized Form
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      javax.servlet.ServletContext getServletContext() 
      void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) 
      void setServletContext(javax.servlet.ServletContext context) 
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
      • Methods inherited from class javax.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, getServletName, init, init, log, log
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IlxWResourceManager

        public IlxWResourceManager()
    • Method Detail

      • getServletContext

        public javax.servlet.ServletContext getServletContext()
        Specified by:
        getServletContext in interface javax.servlet.ServletConfig
        Overrides:
        getServletContext in class javax.servlet.GenericServlet
      • setServletContext

        public void setServletContext(javax.servlet.ServletContext context)
      • service

        public void service(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse resp)
                     throws java.io.IOException,
                            javax.servlet.ServletException
        Overrides:
        service in class javax.servlet.http.HttpServlet
        Throws:
        java.io.IOException
        javax.servlet.ServletException

© Copyright IBM Corp. 1987, 2017