Class PrefabControllerServlet

  • All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.EnvironmentAware, org.springframework.core.env.EnvironmentCapable

    public class PrefabControllerServlet
    extends org.springframework.web.servlet.DispatcherServlet
    Front controller to handle service requests directed at Spring prefabs. This servlet receives service requests for prefabs, matches it with one of the registered contexts and forwards it to the appropriate Controller. To integrate prefab library with a web application include the following snippet in web.xml.
    <servlet>
    <servlet-name>prefabs</servlet-name>
    <servlet-class>com.wavemaker.runtime.prefab.web.PrefabControllerServlet</servlet-class>
    <init-param>
    <param-name>contextClass</param-name>
    <param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
    </init-param>
    <init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>com.wavemaker.runtime.prefab.PrefabServletConfig</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>prefabs</servlet-name>
    <url-pattern>/prefabs/*</url-pattern> </servlet-mapping>
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class org.springframework.web.servlet.DispatcherServlet

        EXCEPTION_ATTRIBUTE, FLASH_MAP_MANAGER_ATTRIBUTE, FLASH_MAP_MANAGER_BEAN_NAME, HANDLER_ADAPTER_BEAN_NAME, HANDLER_EXCEPTION_RESOLVER_BEAN_NAME, HANDLER_MAPPING_BEAN_NAME, INPUT_FLASH_MAP_ATTRIBUTE, LOCALE_RESOLVER_ATTRIBUTE, LOCALE_RESOLVER_BEAN_NAME, MULTIPART_RESOLVER_BEAN_NAME, OUTPUT_FLASH_MAP_ATTRIBUTE, PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger, REQUEST_TO_VIEW_NAME_TRANSLATOR_BEAN_NAME, THEME_RESOLVER_ATTRIBUTE, THEME_RESOLVER_BEAN_NAME, THEME_SOURCE_ATTRIBUTE, VIEW_RESOLVER_BEAN_NAME, WEB_APPLICATION_CONTEXT_ATTRIBUTE
      • Fields inherited from class org.springframework.web.servlet.FrameworkServlet

        DEFAULT_CONTEXT_CLASS, DEFAULT_NAMESPACE_SUFFIX, SERVLET_CONTEXT_PREFIX
    • Constructor Summary

      Constructors 
      Constructor Description
      PrefabControllerServlet()
      Creates a new PrefabControllerServlet.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doDispatch​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      protected org.springframework.web.servlet.HandlerExecutionChain getHandler​(javax.servlet.http.HttpServletRequest request)  
      protected org.springframework.web.servlet.HandlerAdapter getHandlerAdapter​(java.lang.Object handler)
      Returns the HandlerAdapter from the prefab context.
      void init​(javax.servlet.ServletConfig config)  
      protected org.springframework.web.servlet.ModelAndView processHandlerException​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler, java.lang.Exception ex)  
      • Methods inherited from class org.springframework.web.servlet.DispatcherServlet

        buildLocaleContext, checkMultipart, cleanupMultipart, createDefaultStrategy, doService, getDefaultStrategies, getDefaultStrategy, getDefaultViewName, getHandlerMappings, getMultipartResolver, getThemeSource, initStrategies, noHandlerFound, onRefresh, render, resolveViewName, setCleanupAfterInclude, setDetectAllHandlerAdapters, setDetectAllHandlerExceptionResolvers, setDetectAllHandlerMappings, setDetectAllViewResolvers, setThrowExceptionIfNoHandlerFound
      • Methods inherited from class org.springframework.web.servlet.FrameworkServlet

        applyInitializers, buildRequestAttributes, configureAndRefreshWebApplicationContext, createWebApplicationContext, createWebApplicationContext, destroy, doDelete, doGet, doOptions, doPost, doPut, doTrace, findWebApplicationContext, getContextAttribute, getContextClass, getContextConfigLocation, getContextId, getNamespace, getServletContextAttributeName, getUsernameForRequest, getWebApplicationContext, initFrameworkServlet, initServletBean, initWebApplicationContext, isEnableLoggingRequestDetails, onApplicationEvent, postProcessWebApplicationContext, processRequest, refresh, service, setApplicationContext, setContextAttribute, setContextClass, setContextConfigLocation, setContextId, setContextInitializerClasses, setContextInitializers, setDispatchOptionsRequest, setDispatchTraceRequest, setEnableLoggingRequestDetails, setNamespace, setPublishContext, setPublishEvents, setThreadContextInheritable
      • Methods inherited from class org.springframework.web.servlet.HttpServletBean

        addRequiredProperty, createEnvironment, getEnvironment, getServletName, init, initBeanWrapper, setEnvironment
      • Methods inherited from class javax.servlet.http.HttpServlet

        doHead, getLastModified, service
      • Methods inherited from class javax.servlet.GenericServlet

        getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, log, log
      • Methods inherited from class java.lang.Object

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

      • PrefabControllerServlet

        public PrefabControllerServlet()
        Creates a new PrefabControllerServlet.
    • Method Detail

      • init

        public void init​(javax.servlet.ServletConfig config)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Servlet
        Overrides:
        init in class javax.servlet.GenericServlet
        Throws:
        javax.servlet.ServletException
      • doDispatch

        protected void doDispatch​(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response)
                           throws java.lang.Exception
        Overrides:
        doDispatch in class org.springframework.web.servlet.DispatcherServlet
        Throws:
        java.lang.Exception
      • getHandler

        protected org.springframework.web.servlet.HandlerExecutionChain getHandler​(javax.servlet.http.HttpServletRequest request)
                                                                            throws java.lang.Exception
        Overrides:
        getHandler in class org.springframework.web.servlet.DispatcherServlet
        Throws:
        java.lang.Exception
      • getHandlerAdapter

        protected org.springframework.web.servlet.HandlerAdapter getHandlerAdapter​(java.lang.Object handler)
                                                                            throws javax.servlet.ServletException
        Returns the HandlerAdapter from the prefab context.
        Overrides:
        getHandlerAdapter in class org.springframework.web.servlet.DispatcherServlet
        Throws:
        javax.servlet.ServletException
      • processHandlerException

        protected org.springframework.web.servlet.ModelAndView processHandlerException​(javax.servlet.http.HttpServletRequest request,
                                                                                       javax.servlet.http.HttpServletResponse response,
                                                                                       java.lang.Object handler,
                                                                                       java.lang.Exception ex)
                                                                                throws java.lang.Exception
        Overrides:
        processHandlerException in class org.springframework.web.servlet.DispatcherServlet
        Throws:
        java.lang.Exception