Author: alexsmirnov
Date: 2008-03-26 18:10:05 -0400 (Wed, 26 Mar 2008)
New Revision: 7282
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
Log:
fix
http://jira.jboss.com/jira/browse/RF-2523
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-03-26
21:42:04 UTC (rev 7281)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-03-26
22:10:05 UTC (rev 7282)
@@ -58,8 +58,6 @@
import org.ajax4jsf.Messages;
import org.ajax4jsf.application.AjaxViewHandler;
-import org.ajax4jsf.component.AjaxContainer;
-import org.ajax4jsf.component.AjaxViewRoot;
import org.ajax4jsf.renderkit.AjaxContainerRenderer;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.RendererUtils;
@@ -68,7 +66,6 @@
import org.ajax4jsf.resource.ResourceNotFoundException;
import org.ajax4jsf.util.ELUtils;
import org.ajax4jsf.webapp.BaseFilter;
-import org.ajax4jsf.webapp.FilterServletResponseWrapper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.richfaces.skin.Skin;
@@ -249,7 +246,6 @@
ResponseWriter out = context.getResponseWriter();
// DebugUtils.traceView("ViewRoot in AJAX Page encode begin");
out.startElement(HTML.HTML_ELEMENT, viewRoot);
- // TODO - html attributes. lang - from current locale ?
Locale locale = viewRoot.getLocale();
out.writeAttribute(HTML.lang_ATTRIBUTE, locale.toString(), "lang");
out.startElement(HTML.BODY_ELEMENT, viewRoot);
@@ -753,9 +749,16 @@
}
ViewHandler viewHandler = context.getApplication().getViewHandler();
String actionURL = viewHandler.getActionURL(context, viewId);
- // Mark Ajax action url as transparent with jsf-portlet bridge.
- actionURL = actionURL + ((actionURL.lastIndexOf('?') > 0) ?
"&" : "?")
- + "javax.portlet.faces.DirectLink=true";
+ // HACK - check for a Jboss PortletBridge implementation. If present, append DirectLink
attribute to url.
+ // TODO - how to detect portlet application ?
+ if (null != context.getExternalContext().getApplicationMap().get(
+ "org.jboss.portletbridge.application.PortletStateHolder")) {
+ // Mark Ajax action url as transparent with jsf-portlet bridge.
+ actionURL = actionURL
+ + ((actionURL.lastIndexOf('?') > 0) ? "&" : "?")
+ + "javax.portlet.faces.DirectLink=true";
+
+ }
return context.getExternalContext().encodeActionURL(actionURL);
}