Skip to main content
Kinetic Community

Helper: BundleHelper

Helpers are essentially Java classes that can be used in JSP pages.  The BundleHelper is a core helper (meaning that it rarely, if ever be modified).  It includes helper methods that simplify very common display logic within the bundle.

Methods

BundleHelper.debugJs(request)

Parameters: javax.servlet.http.HttpServletRequest

Returns: boolean

Returns true if there is a "debugjs" parameter was passed with the HTTP request and the value is set to "true" (case insensitive).  The purpose of this parameter is to load the complete javascript source files instead of the minified versions.  This allows for easier troubleshooting and debugging.  Minified versions are normally used for faster page loads.

URL Example

http://requestserver:8080/kinetic/DisplayPage?name=catalog&debugjs=true

JSP Example

<% if (BundleHelper.debugJs(request)) { %>
<script type="text/javascript" src="<%=bundle.packagePath()%>/resources/js/package.js"></script>
<% } else { %>
<script type="text/javascript" src="<%=bundle.packagePath()%>/resources/js/package-min.js"></script>
<% } %>

BundleHelper.isBlank(object)

Parameters: Object

Returns: boolean

Returns true if the object is not null, not false, and the object.toString() value contains characters other than whitespace.

Example

<% if(!BundleHelper.isBlank(object.getProperty("Name")) { %>
<%= object.getProperty("Name") %>
<% } %>

BundleHelper.timestamp()

Parameters:

Returns: String

Returns a String representation of the current time in milliseconds since Epoch.

Example

<%=BundleHelper.timestamp()%>