When developing J2EE applications it is sometimes useful to access the configuration directly from JSPs. EasyConf provides two jsp tags for this purpose:
The tag library definition file (TLD) for this libraries can be found inside the easyconf-${version}.jar file, inside the tld directory.
Tag attributes
Example (String property)
<%@ taglib uri="/WEB-INF/tld/easyconf.tld" prefix="easyconf" %>
<easyconf:property id="advertisement_enabled"
component="xpression-ui"
property="login.advertisement.enabled"
selector1="<%=request.getParameter("show-ad")%>/>
<logic:equals name="advertisement_enabled" value="true"/>
...
</logic:equals>
Example (java.util.List property)
<%@ taglib uri="/WEB-INF/tld/easyconf.tld" prefix="easyconf" %>
<easyconf:property id="companies"
component="presentation"
property="partner.names"
type="java.util.list"
%>/>
<logic:iterate id="companyName" name="companies"/>
...
</logic:iterate>
Tag attributes
Example
<%@ taglib uri="/WEB-INF/tld/easyconf.tld" prefix="easyconf" %>
<easyconf:configurationObject id="cmsConfig"
component="xpression-cms"
type="com.foo.bar.cms.ContentTypeDefinitions"/>
<logic:iterate id="type" name="cmsConfig" property="contentTypes">
...
</logic:iterate>
It is a good practice when working with J2EE taglibs to use a symbolic URI instead of the real path to the tld file. The URI that you should use to refer the EasyConf taglib is:
http://easyconf.sourceforge.net/easyconf-tags
One way to map this URI to the real location of the tld file is adding the following lines in appropriate place inside the web.xml file:
<taglib>
<taglib-uri>http://easyconf.sourceforge.net/easyconf-tags</taglib-uri>
<taglib-location>/WEB-INF/tld/easyconf.tld</taglib-location>
</taglib>