Author: thomas.heute(a)jboss.com
Date: 2007-11-13 03:57:24 -0500 (Tue, 13 Nov 2007)
New Revision: 8895
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
JBPORTAL-1729: AjaxInterceptor with a different context root
Contribution from Luca Stancapiano
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java 2007-11-13
08:55:07 UTC (rev 8894)
+++
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java 2007-11-13
08:57:24 UTC (rev 8895)
@@ -39,11 +39,18 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author Luca Stancapiano
* @version $Revision$
*/
public class AjaxInterceptor extends ControllerInterceptor
{
-
+ /**
+ * Luca Stancapiano - 29 - 09 -2007
+ * targetContextPath is used to assign a context path when
+ * default portal-ajax path cannot to be used or if it is changed through context-root
property into jboss-web.xml
+ * */
+ private String targetContextPath = "/portal-ajax";
+
public ControllerResponse invoke(ControllerCommand cmd) throws Exception,
InvocationException
{
ControllerResponse response = (ControllerResponse)cmd.invokeNext();
@@ -70,7 +77,7 @@
String url = serverContext.renderURL(baseServerURL,
serverContext.getURLContext(), URLFormat.newInstance(true, true));
//
- pageProps.put(DynaConstants.RESOURCE_BASE_URL, "/portal-ajax/dyna");
+ pageProps.put(DynaConstants.RESOURCE_BASE_URL, targetContextPath +
"/dyna");
pageProps.put(DynaConstants.SERVER_BASE_URL, url);
pageProps.put(DynaConstants.VIEW_STATE, viewId);
@@ -88,4 +95,14 @@
//
return response;
}
+
+ public String getTargetContextPath()
+ {
+ return targetContextPath;
+ }
+
+ public void setTargetContextPath(String context)
+ {
+ targetContextPath = context;
+ }
}
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-11-13
08:55:07 UTC (rev 8894)
+++
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-11-13
08:57:24 UTC (rev 8895)
@@ -188,6 +188,11 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <!--
+ this tag has to be set when context root of portal-ajax is
+ different by /portal-ajax path.
+ Uncomment and change it if you want to change context root for portal-ajax
application
+ <attribute name="TargetContextPath">/portal-ajax</attribute>
-->
</mbean>
<mbean
code="org.jboss.portal.core.aspects.controller.NavigationalStateInterceptor"
Show replies by date