-
Notifications
You must be signed in to change notification settings - Fork 30
The Molding System
The Molding System is a powerful feature of Bootstrap.jsp that allows you to knock out Components with the same characteristics time and time again just by setting the mold
attribute in your JSP page.
The value of the mold
attribute can either be the name of a class that extends the org.bootstrapjsp.mold.Mold
class, or be resolved into one via the Bootstrap.jsp properties file, or an artibrary mold name whose attributes are defined in the properties file.
Let's define a simple properties based mold for the panel
Component as an example. Place the following properties in your WEB-INF/classes/bootstrapjsp_local.properties file:
panel.mold.danger.context=danger
panel.mold.danger.label=Danger!
Now create a panel
with 'danger' as the value of the mold
attribute:
<b:panel mold="danger">You probably don't want to do that</b:panel>
The context
and label
attributes are found in the properties file and set on your panel
:
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">Danger!</h3>
</div>
<div class="panel-body">
You probably don't want to do that
</div>
</div>