You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mk...@apache.org on 2007/03/29 17:36:07 UTC

svn commit: r523749 - /myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/excelexport/ExcelExportRenderer.java

Author: mkienenb
Date: Thu Mar 29 08:36:06 2007
New Revision: 523749

URL: http://svn.apache.org/viewvc?view=rev&rev=523749
Log:
Fix for TOMAHAWK-941 - Make ExcelExport work for suffixes other than *.jsf, for example when using *.faces or *.xhtml.
Thanks to Marco Poehler.

Modified:
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/excelexport/ExcelExportRenderer.java

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/excelexport/ExcelExportRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/excelexport/ExcelExportRenderer.java?view=diff&rev=523749&r1=523748&r2=523749
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/excelexport/ExcelExportRenderer.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/excelexport/ExcelExportRenderer.java Thu Mar 29 08:36:06 2007
@@ -67,8 +67,10 @@
 	
 	private String getJSCall(FacesContext facesContext, String tableId) {
 		String viewId = StringUtils.split( facesContext.getViewRoot().getViewId() , "\\.")[0];
-		String contextPath = facesContext.getExternalContext().getRequestContextPath();
-		return "window.open('" + contextPath + viewId + ".jsf?excelExportTableId=" + tableId + "');return false;";
+		return "window.open('"
+				+ facesContext.getApplication().getViewHandler().getActionURL(
+						facesContext, viewId) + "?excelExportTableId="
+				+ tableId + "');return false;";
 	}