Revision: 1397
http://stripes.svn.sourceforge.net/stripes/?rev=1397&view=rev
Author: bengunter
Date: 2011-02-04 18:33:50 +0000 (Fri, 04 Feb 2011)
Log Message:
-----------
Did a little code cleanup in some layout classes.
Modified Paths:
--------------
trunk/stripes/src/net/sourceforge/stripes/tag/layout/LayoutComponentRenderer.java
trunk/stripes/src/net/sourceforge/stripes/tag/layout/LayoutRenderTag.java
Modified:
trunk/stripes/src/net/sourceforge/stripes/tag/layout/LayoutComponentRenderer.java
===================================================================
---
trunk/stripes/src/net/sourceforge/stripes/tag/layout/LayoutComponentRenderer.java
2011-02-04 18:31:11 UTC (rev 1396)
+++
trunk/stripes/src/net/sourceforge/stripes/tag/layout/LayoutComponentRenderer.java
2011-02-04 18:33:50 UTC (rev 1397)
@@ -67,17 +67,17 @@
this.pageContext = new LinkedList<PageContext>();
}
- this.pageContext.add(pageContext);
+ this.pageContext.addFirst(pageContext);
}
/** Pop the last page context off the stack and return it. */
public PageContext popPageContext() {
- return pageContext == null || pageContext.isEmpty() ? null :
pageContext.removeLast();
+ return pageContext == null ? null : pageContext.poll();
}
/** Get the last page context that was pushed onto the stack. */
public PageContext getPageContext() {
- return pageContext == null || pageContext.isEmpty() ? null :
pageContext.getLast();
+ return pageContext == null ? null : pageContext.peek();
}
/** Get the path to the currently executing JSP. */
Modified:
trunk/stripes/src/net/sourceforge/stripes/tag/layout/LayoutRenderTag.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/tag/layout/LayoutRenderTag.java
2011-02-04 18:31:11 UTC (rev 1396)
+++ trunk/stripes/src/net/sourceforge/stripes/tag/layout/LayoutRenderTag.java
2011-02-04 18:33:50 UTC (rev 1397)
@@ -50,16 +50,15 @@
public LayoutContext getContext() {
if (context == null) {
LayoutContext context = LayoutContext.lookup(pageContext);
- boolean contextIsNew = false;
- if (context == null || !context.isComponentRenderPhase()
- || context.isComponentRenderPhase() &&
isChildOfCurrentComponent()) {
+ boolean create = context == null ||
!context.isComponentRenderPhase()
+ || context.isComponentRenderPhase() &&
isChildOfCurrentComponent();
+
+ if (create)
context = LayoutContext.push(this);
- contextIsNew = true;
- }
this.context = context;
- this.contextIsNew = contextIsNew;
+ this.contextIsNew = create;
}
return context;
@@ -78,11 +77,6 @@
}
}
- /** True if this is the outermost layout tag, the one that initiated the
render process. */
- public boolean isOuterLayoutTag() {
- return getLayoutParent() == null;
- }
-
/** Used by the JSP container to provide the tag with dynamic attributes.
*/
public void setDynamicAttribute(String uri, String localName, Object
value) throws JspException {
getContext().getParameters().put(localName, value);
@@ -157,10 +151,8 @@
try {
log.debug("Start layout exec in ",
context.getDefinitionPage());
- boolean silent = context.getOut().isSilent();
context.getOut().setSilent(true, pageContext);
context.doInclude(pageContext, getName());
- context.getOut().setSilent(silent, pageContext);
log.debug("End layout exec in ",
context.getDefinitionPage());
}
catch (Exception e) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world?
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development