Package com.hybris.cockpitng.util.labels
Class WebappLabelLocator
- java.lang.Object
-
- com.hybris.cockpitng.util.labels.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.ServletContextAwareLabel 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>
-
-
Constructor Summary
Constructors Constructor Description WebappLabelLocator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit()Registers this label locator.java.net.URLlocate(java.util.Locale locale)voidsetLocation(java.lang.String location)Sets the location of the localization files within your web application.voidsetName(java.lang.String name)Sets the prefix of the label files.voidsetServletContext(javax.servlet.ServletContext servletContext)
-
-
-
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 (@seesetLocation(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:
locatein interfaceorg.zkoss.util.resource.LabelLocator
-
setServletContext
public void setServletContext(javax.servlet.ServletContext servletContext)
- Specified by:
setServletContextin interfaceorg.springframework.web.context.ServletContextAware
-
-