Workaround added to WebScript status template to handle very strange proxied Hibernate Exception objects.

Fix to PageTag to work outside of a valid FacesContext scope.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10122 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2008-07-30 13:08:14 +00:00
parent 872b6c940c
commit 979d719f54

View File

@@ -371,9 +371,12 @@ public class PageTag extends TagSupport
*/ */
private String getWindowOnloadCode() private String getWindowOnloadCode()
{ {
CCProperties ccProps = (CCProperties) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "CCProperties"); FacesContext fc = FacesContext.getCurrentInstance();
if (fc != null)
{
CCProperties ccProps = (CCProperties) FacesHelper.getManagedBean(fc, "CCProperties");
StringBuffer onloadCode = new StringBuffer(); StringBuilder onloadCode = new StringBuilder();
if (ccProps.getWebdavUrl() != null || ccProps.getCifsPath() != null) if (ccProps.getWebdavUrl() != null || ccProps.getCifsPath() != null)
{ {
String webdavUrl = (ccProps.getWebdavUrl() != null) ? (ccProps.getWebdavUrl()) : (""); String webdavUrl = (ccProps.getWebdavUrl() != null) ? (ccProps.getWebdavUrl()) : ("");
@@ -387,5 +390,9 @@ public class PageTag extends TagSupport
return onloadCode.toString(); return onloadCode.toString();
} }
else
{
return "";
}
}
} }