Class WebappLabelLocator

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.web.context.ServletContextAware, org.zkoss.util.resource.LabelLocator

    public class WebappLabelLocator
    extends java.lang.Object
    implements org.zkoss.util.resource.LabelLocator, org.springframework.web.context.ServletContextAware
    Label locator for a web application. Use it to locate labels on a web application level. To activate and configure add a spring bean to your web spring xml file like this: <bean id="mywebappLabelLocator" class="com.hybris.cockpitng.util.labels.WebappLabelLocator" scope= "singleton" init-method="init" lazy-init="false"> <property name="location" value="/WEB-INF/labels"/> <property name="name" value="labels"/> </bean>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void init()
      Registers this label locator.
      java.net.URL locate​(java.util.Locale locale)  
      void setLocation​(java.lang.String location)
      Sets the location of the localization files within your web application.
      void setName​(java.lang.String name)
      Sets the prefix of the label files.
      void setServletContext​(javax.servlet.ServletContext servletContext)  
      • Methods inherited from class java.lang.Object

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

      • WebappLabelLocator

        public WebappLabelLocator()
    • Method Detail

      • init

        public void init()
        Registers this label locator. Should be specified as init-method if this will be registered as a spring bean.
      • setLocation

        public void setLocation​(java.lang.String location)
        Sets the location of the localization files within your web application. It must point to the directory which contain the files. Example: '/WEB-INF/labels'.
        Parameters:
        location - location of the localization files within your web application (a directory)
      • setName

        public void setName​(java.lang.String name)
        Sets the prefix of the label files. Will be used to locate the labels files in the specified location (@see setLocation(String)). For example: setting the name to 'labels' will look for files with naming scheme labels_.properties where is the code of the current locale. (The default fallback file will be labels.properties in this case.)
        Parameters:
        name - prefix of the label files
      • locate

        public java.net.URL locate​(java.util.Locale locale)
        Specified by:
        locate in interface org.zkoss.util.resource.LabelLocator
      • setServletContext

        public void setServletContext​(javax.servlet.ServletContext servletContext)
        Specified by:
        setServletContext in interface org.springframework.web.context.ServletContextAware