Revision: 1287
http://stripes.svn.sourceforge.net/stripes/?rev=1287&view=rev
Author: bengunter
Date: 2010-09-29 02:53:57 +0000 (Wed, 29 Sep 2010)
Log Message:
-----------
STS-391: Removed a check that prevented a component renderer from executing the
currently executing page again. Invoking the current page is actually required
sometimes, and after some recent changes no longer causes problems.
Modified Paths:
--------------
branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/layout/LayoutComponentRenderer.java
Modified:
branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/layout/LayoutComponentRenderer.java
===================================================================
---
branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/layout/LayoutComponentRenderer.java
2010-09-29 02:47:13 UTC (rev 1286)
+++
branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/layout/LayoutComponentRenderer.java
2010-09-29 02:53:57 UTC (rev 1287)
@@ -80,6 +80,12 @@
return pageContext == null || pageContext.isEmpty() ? null :
pageContext.getLast();
}
+ /** Get the path to the currently executing JSP. */
+ public String getCurrentPage() {
+ return (String) getPageContext().getRequest().getAttribute(
+ StripesConstants.REQ_ATTR_INCLUDE_PATH);
+ }
+
/**
* Indicates the context in the stack of layout contexts against which the
component is being
* rendered. Any attempt to render a component with the same name as the
component currently
@@ -105,24 +111,18 @@
return false;
}
- // Get the current page so we can be sure not to invoke it again (see
below)
- final String currentPage = (String)
pageContext.getRequest().getAttribute(
- StripesConstants.REQ_ATTR_INCLUDE_PATH);
-
// Grab some values from the current context so they can be restored
when we're done
final LayoutContext context = LayoutContext.lookup(pageContext);
final boolean phaseFlag = context.isComponentRenderPhase();
final String component = context.getComponent();
final boolean silent = context.getOut().isSilent();
final LayoutContext currentSource = getSourceContext();
- log.debug("Render component \"", componentName, "\" in ", currentPage);
+ log.debug("Render component \"", componentName, "\" in ",
getCurrentPage());
// Descend the stack from here, trying each context where the
component is registered
for (LayoutContext source = currentSource == null ? context :
currentSource.getPrevious(); source != null; source = source.getPrevious()) {
- // Skip contexts where the desired component is not registered or
which would invoke the
- // current page again.
- if (!source.getComponents().containsKey(componentName)
- || source.getRenderPage().equals(currentPage)) {
+ // Skip contexts where the desired component is not registered.
+ if (!source.getComponents().containsKey(componentName)) {
log.trace("Not rendering \"", componentName, "\" in context ",
source
.getRenderPage(), " -> ", source.getDefinitionPage());
continue;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development