Skip to main content

Apple is now giving away its iWork and iLife apps:Free to iPhone, iPad, Mac users

You can now get Apple's iWork Office rival and iLife apps for free.

Popular posts from this blog

Simple EJB timer exposed as REST resource

@Path("timers") @StatelesspublicclassTimerResource { privatestaticfinalLogger logger =Logger.getLogger(TimerResource.class.getName()); @ResourceprivateTimerService timerService; @Timeoutpublicvoidrun() { logger.info("Timer triggered at "+newDate()); } @POSTpublicStringstartTimer() { timerService.createTimer(10000, 10000, "triggers every 10 seconds"); logger.info("Timer scheduled to fire every 10 seconds"); return"Timer scheduled to fire every 10 seconds"; } } Download the war file from Download

simpleEJBtimerForTesting

String functions in JSF EL (JSF Expression Language)

Add JSTL functions namespace in Facelets XHTML:

xmlns:fn="http://java.sun.com/jsp/jstl/functions"
Example1:

#{fn:startsWith(beanName.fieldName,'PREFIX_')}

Example 2:
<c:forEachitems="${contacts}"var="contact">
<c:iftest="${not fn:containsIgnoreCase(contact, 'i88.ca')}"> <p>Doesn't contain 'i88.ca'</p>
</c:if>
</c:forEach> Other functions:toUpperCase, toLowerCase: Changes the capitalization of a stringsubstring, substringBefore, substringAfter: Gets a subset of a stringtrim: Trims white space from a stringreplace: Replaces characters in a stringindexOf, startsWith, endsWith, contains, containsIgnoreCase: Checks whether a string contains another stringsplit: Splits a string into an arrayjoin: Joins a collection into a stringescapeXml: Escapes XML characters in a stringlength: Returns the number of items in a collection, or the number of characters in a stringSee also:
http://docs.…