You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bridges-dev@portals.apache.org by Max Hammers <ha...@yahoo.it> on 2006/02/13 17:57:46 UTC
Fwd2: Struts Bridge - error with tiles
Sorry,
this is the missing attached file
(StrutsBridge.patch):
##########################
Index:
src/java/org/apache/portals/bridges/struts/PortletServlet.java
===================================================================
---
src/java/org/apache/portals/bridges/struts/PortletServlet.java
(revision 365364)
+++
src/java/org/apache/portals/bridges/struts/PortletServlet.java
(working copy)
@@ -34,6 +34,7 @@
import org.apache.struts.config.PlugInConfig;
import org.apache.struts.tiles.TilesPlugin;
import org.apache.struts.util.RequestUtils;
+import
org.apache.struts.taglib.tiles.ComponentConstants;
/**
* PortletServlet
@@ -169,6 +170,13 @@
request
.setAttribute(Globals.ERROR_KEY, context
.getErrors());
+ log.debug("Looking for TilesContext
...");
+ if (context.getTilesContext() !=
null) {
+
request.setAttribute(ComponentConstants.COMPONENT_CONTEXT,
context.getTilesContext());
+ log.debug("TilesContext saved in
request");
+ } else
+ log.debug("TilesContext not found!");
+
RequestDispatcher dispatcher = null;
if (context.getDispatchNamed())
dispatcher =
getServletContext().getNamedDispatcher(
Index:
src/java/org/apache/portals/bridges/struts/PortletServletRequestDispatcher.java
===================================================================
---
src/java/org/apache/portals/bridges/struts/PortletServletRequestDispatcher.java
(revision 365364)
+++
src/java/org/apache/portals/bridges/struts/PortletServletRequestDispatcher.java
(working copy)
@@ -30,6 +30,8 @@
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMessages;
import org.apache.struts.config.ActionConfig;
+import org.apache.struts.tiles.ComponentContext;
+import
org.apache.struts.taglib.tiles.ComponentConstants;
/**
* PortletServletRequestDispatcher
@@ -92,6 +94,11 @@
.getAttribute(Globals.MESSAGE_KEY));
context.setErrors((ActionMessages)
request
.getAttribute(Globals.ERROR_KEY));
+ // Store tiles context
+
context.setTilesContext((ComponentContext)request.getAttribute(ComponentConstants.COMPONENT_CONTEXT));
+ log.debug("TilesContext in
StrutsPortletRenderContext");
+
+
if (context.getErrors() != null)
{
String originURL =
StrutsPortletURL.getOriginURL(request);
Index:
src/java/org/apache/portals/bridges/struts/StrutsPortletRenderContext.java
===================================================================
---
src/java/org/apache/portals/bridges/struts/StrutsPortletRenderContext.java
(revision 365364)
+++
src/java/org/apache/portals/bridges/struts/StrutsPortletRenderContext.java
(working copy)
@@ -19,6 +19,7 @@
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMessages;
+import org.apache.struts.tiles.ComponentContext;
/**
* StrutsPortletRenderContext
@@ -34,6 +35,9 @@
private boolean requestCancelled;
private ActionMessages messages;
private ActionMessages errors;
+ // Tiles context
+ private ComponentContext tilesContext;
+
public String getPath()
{
return path;
@@ -82,4 +86,12 @@
{
this.errors = errors;
}
+ public ComponentContext getTilesContext()
+ {
+ return tilesContext;
+ }
+ public void setTilesContext(ComponentContext
tilesContext)
+ {
+ this.tilesContext = tilesContext;
+ }
}
##########################
Max
--- Max Hammers <ha...@yahoo.it> ha scritto:
> Data: Mon, 13 Feb 2006 16:07:28 +0100 (CET)
> Da: Max Hammers <ha...@yahoo.it>
> Oggetto: Fwd: Struts Bridge - error with tiles
> A: bridges-dev@portals.apache.org
>
> Hi,
> I developed a very simple patch to solve
> problem
> with tiles. This patch is a natural extension of
> Struts Bridge code, as you can see in the attached
> file (StrutsBridge.patch).
> I hope you'll find it useful.
>
> Best regards,
> Max
>
___________________________________
Yahoo! Messenger with Voice: chiama da PC a telefono a tariffe esclusive
http://it.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: bridges-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: bridges-dev-help@portals.apache.org