Created
June 21, 2013 13:53
-
-
Save abickford/5831317 to your computer and use it in GitHub Desktop.
Evaluating Java System Properties in JSP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spring context XML: | |
<!-- expose specific properties to application --> | |
<bean id="applicationProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> | |
<property name="singleton" value="true" /> | |
<property name="properties"> | |
<props> | |
<prop key="frontleaf.enabled">${frontleaf.enabled}</prop> | |
<prop key="frontleaf.streamname">${frontleaf.streamname}</prop> | |
</props> | |
</property> | |
</bean> | |
JSP: | |
<spring:eval expression="@applicationProperties.getProperty('frontleaf.enabled')" var="frontleafEnabled" /> | |
<c:if test="${frontleafEnabled}"> | |
<spring:eval expression="@applicationProperties.getProperty('frontleaf.streamname')" var="frontleafStreamname" /> | |
<script> | |
.... | |
</script> | |
</c:if> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment