Update of
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/functions
In directory james.mmbase.org:/tmp/cvs-serv5949
Modified Files:
Tag: MMBase-1_8
Functions.java
Log Message:
avoid exception if file not found
See also:
http://cvs.mmbase.org/viewcvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/functions
Index: Functions.java
===================================================================
RCS file:
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/functions/Functions.java,v
retrieving revision 1.15.2.3
retrieving revision 1.15.2.4
diff -u -b -r1.15.2.3 -r1.15.2.4
--- Functions.java 12 Oct 2007 16:15:19 -0000 1.15.2.3
+++ Functions.java 14 Mar 2008 15:35:48 -0000 1.15.2.4
@@ -39,7 +39,7 @@
</mm:cloud>
* @author Michiel Meeuwissen
* @since MMBase-1.8
- * @version $Id: Functions.java,v 1.15.2.3 2007/10/12 16:15:19 michiel Exp $
+ * @version $Id: Functions.java,v 1.15.2.4 2008/03/14 15:35:48 michiel Exp $
* @todo EXPERIMENTAL
*/
public class Functions {
@@ -140,7 +140,12 @@
th.setCloud((Cloud) pageContext.getAttribute(CloudTag.KEY,
CloudTag.SCOPE));
javax.servlet.http.HttpServletRequest req =
(javax.servlet.http.HttpServletRequest) pageContext.getRequest();
String t = th.findTreeFile(page, Casting.toString(objectList),
pageContext.getSession());
- return req.getContextPath() + (t.charAt(0) == '/' ? "" : "/") + t;
+ if (t == null || "".equals(t)) {
+ // not found, avoid Exceptions, this will generaly produce a 404
in stead. Which is
+ // clear enough.
+ t = page;
+ }
+ return req.getContextPath() + ((t.length() > 1 && t.charAt(0) == '/')
? "" : "/") + t;
}
/**
* @since MMBase-1.8.5
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs