Class WmViewResolver

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.core.Ordered, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.ViewResolver

    public class WmViewResolver
    extends org.springframework.web.servlet.view.InternalResourceViewResolver
    View resolver for webmanager views. if the requested view holds a componentid (terminalted by SprimgMvcConstants.VIEW_COMPONENTID_SEPARATOR) 1) the jsp is first lookup in the component private directory (format: componentIdPrefix+COMPONENT_ID+componentIdSuffix+viewname) 2) if not exists then in de default webmanager directory if the view doesn't hold a component ID, the default webmanager directory is used.
    Author:
    johntd
    • Field Summary

      • Fields inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver

        FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX
      • Fields inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver

        DEFAULT_CACHE_LIMIT
      • Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

        logger
      • Fields inherited from interface org.springframework.core.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Constructor Summary

      Constructors 
      Constructor Description
      WmViewResolver()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.springframework.web.servlet.view.AbstractUrlBasedView buildView​(String viewName)
      builds the real viewname.
      protected boolean canHandle​(String viewName, Locale locale)  
      String getDefaultWebManagerPrefix()
      get the defaultWebManagerPrefix.
      protected Framework getServiceFramework()
      Get the service framework (injected by Spring).
      void setDefaultWebManagerPrefix​(String defaultWebManagerPrefix)
      set the defaultWebManagerPrefix (injected by Spring).
      void setServiceFramework​(Framework serviceFramework)
      Set the service framework (injected by Spring).
      • Methods inherited from class org.springframework.web.servlet.view.InternalResourceViewResolver

        requiredViewClass, setAlwaysInclude, setExposeContextBeansAsAttributes, setExposedContextBeanNames
      • Methods inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver

        createView, getAttributesMap, getCacheKey, getContentType, getExposePathVariables, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setExposePathVariables, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames
      • Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver

        clearCache, getCacheLimit, isCache, isCacheUnresolved, removeFromCache, resolveViewName, setCache, setCacheLimit, setCacheUnresolved
      • Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

        getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
      • Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

        getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
    • Constructor Detail

      • WmViewResolver

        public WmViewResolver()
    • Method Detail

      • setServiceFramework

        public void setServiceFramework​(Framework serviceFramework)
        Set the service framework (injected by Spring).
        Parameters:
        serviceFramework - the serviceframework
      • getServiceFramework

        protected Framework getServiceFramework()
        Get the service framework (injected by Spring).
        Returns:
        the serficeframework
      • setDefaultWebManagerPrefix

        public void setDefaultWebManagerPrefix​(String defaultWebManagerPrefix)
        set the defaultWebManagerPrefix (injected by Spring).
        Parameters:
        defaultWebManagerPrefix - defaultWebManagerPrefix
      • getDefaultWebManagerPrefix

        public String getDefaultWebManagerPrefix()
        get the defaultWebManagerPrefix.
        Returns:
        defaultWebManagerPrefix
      • buildView

        protected org.springframework.web.servlet.view.AbstractUrlBasedView buildView​(String viewName)
                                                                               throws Exception
        builds the real viewname. If viewName contains an componentId first the jsp view is looked-up in the componentID specific directoy if not exists the default webmanager view is build if the viewName does not contain an componentId the default webmanager view is build. view formats: component specific : /WEB-INF/wm/jsp/edit/wcb/{bundle_id}/{viewName}(.jsp = suffix) default webmanager : /WEB-INF/wm/jsp/{viewName}(.jsp = suffix)
        Overrides:
        buildView in class org.springframework.web.servlet.view.InternalResourceViewResolver
        Parameters:
        viewName - holds the viewname, optional prefixed by the componentId (format: componentFileId + SpringMvcConstants.VIEW_COMPONENTID_SEPARATOR + spingViewName) (if no SpringMvcConstants.VIEW_COMPONENTID_SEPARATOR then only: spingViewName)
        Returns:
        url for the view to be rendered
        Throws:
        Exception - from super();
      • canHandle

        protected boolean canHandle​(String viewName,
                                    Locale locale)
        Overrides:
        canHandle in class org.springframework.web.servlet.view.UrlBasedViewResolver