You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by sa...@apache.org on 2010/10/12 13:04:49 UTC
svn commit: r1021740 -
/click/trunk/click/framework/src/org/apache/click/ClickServlet.java
Author: sabob
Date: Tue Oct 12 11:04:49 2010
New Revision: 1021740
URL: http://svn.apache.org/viewvc?rev=1021740&view=rev
Log:
lookup ThreadLocal Context only once inside method
Modified:
click/trunk/click/framework/src/org/apache/click/ClickServlet.java
Modified: click/trunk/click/framework/src/org/apache/click/ClickServlet.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/ClickServlet.java?rev=1021740&r1=1021739&r2=1021740&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/ClickServlet.java (original)
+++ click/trunk/click/framework/src/org/apache/click/ClickServlet.java Tue Oct 12 11:04:49 2010
@@ -1125,11 +1125,12 @@ public class ClickServlet extends HttpSe
*/
@SuppressWarnings("deprecation")
protected void processPageOnDestroy(Page page, long startTime) {
+ Context context = page.getContext();
if (page.hasControls()) {
// notify callbacks of destroy event
// TODO check that exceptions don't unnecessarily trigger preDestroy
- ControlRegistry.getThreadLocalRegistry().processPreDestroy(page.getContext());
+ ControlRegistry.getThreadLocalRegistry().processPreDestroy(context);
List<Control> controls = page.getControls();
@@ -1154,7 +1155,7 @@ public class ClickServlet extends HttpSe
// Reset the page navigation state
try {
// Reset the path
- String path = page.getContext().getResourcePath();
+ String path = context.getResourcePath();
page.setPath(path);
// Reset the forward
@@ -1175,9 +1176,9 @@ public class ClickServlet extends HttpSe
page.onDestroy();
if (page.isStateful()) {
- page.getContext().setSessionAttribute(page.getClass().getName(), page);
+ context.setSessionAttribute(page.getClass().getName(), page);
} else {
- page.getContext().removeSessionAttribute(page.getClass().getName());
+ context.removeSessionAttribute(page.getClass().getName());
}
if (logger.isTraceEnabled()) {