Skip to content

Instantly share code, notes, and snippets.

@jamesfalkner
Created November 15, 2013 20:20
Show Gist options
  • Save jamesfalkner/7490924 to your computer and use it in GitHub Desktop.
Save jamesfalkner/7490924 to your computer and use it in GitHub Desktop.
## Portlet lifecycle: long-running process in RESOURCE_PHASE
#if ($request.lifecycle == "RENDER_PHASE")
<em>Demo 2: Long-running process that doesn't hang</em>
<h1>Hello, Liferay!</h1>
<img src="http://www.liferay.com/osb-community-theme/images/custom/heading.png">
<h3>Didn't take very long, did it?</h3>
#elseif ($request.lifecycle == "RESOURCE_PHASE")
## long-running process that only runs if the resource URL is accessed
#set ($start = $dateUtil.newDate())
#foreach ($i in [1..15000000])
#end
#set ($elapsed = $dateUtil.newDate().getTime() - $start.getTime())
#end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment