Friday, March 14, 2014
Spring Java Script Decorator Message Internationalization
How do I achieve internationalization when using Spring Java Script Decorator?
See the following example for the answer. Note that text.invalid.coordinates should be defined in a message.properties file where the JSP can access.
<div class="sp-field">
<form:input cssClass="sp-textfield" path="missingNetworkNodeList.elements[${rowCounter.index}].coordinates.latitudeLongitude" />
<spring:message code="text.invalid.coordinates" var="invalidCor"/>
<script type="text/javascript">
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "missingNetworkNodeList.elements${rowCounter.index}.coordinates.latitudeLongitude",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : {
invalidMessage: "${invalidCor}",
regExp: "^-?([0-8]?[0-9])\.[0-9]{1,6},-?((1?[0-7]?|[0-9]?)[0-9])\.[0-9]{1,6}"
}
}));
</script>
</div>
Tuesday, January 7, 2014
Tiles Definition: Nested
The following is an example of nested Tiles Definition:
<definition name="myapp.homepage.body" template="/layouts/three_rows.jsp"> <put-attribute name="one" value="/tiles/headlines.jsp" /> <put-attribute name="two" value="/tiles/topics.jsp" /> <put-attribute name="one" value="/tiles/comments.jsp" /> </definition> <definition name="myapp.homepage" template="/layouts/classic.jsp"> <put-attribute name="title" value="Tiles tutorial homepage" /> <put-attribute name="header" value="/tiles/banner.jsp" /> <put-attribute name="menu" value="/tiles/common_menu.jsp" /> <put-attribute name="body" value="myapp.homepage.body" /> <put-attribute name="footer" value="/tiles/credits.jsp" /> </definition>
The following apache link provides some very good information on Tiles Definition.
http://tiles.apache.org/framework/tutorial/advanced/nesting-extending.html
JSP EL
A primary feature of JSP technology version 2.0 is its support
for an expression language (EL). An expression language makes it possible to
easily access application data stored in JavaBeans components. For example, the
JSP expression language allows a page author to access a bean using simple
syntax such as
${name}
for a simple variable or ${name.foo.bar}
for a nested property.
for more information, check out this EL tutorial:
Subscribe to:
Posts (Atom)