AW: [opencms-dev] inclusion loop when using recursive method ?

Frank Wunderlich k.frank.wunderlich at gmx.de
Thu Jun 12 17:23:01 CEST 2003


Hi Nicolas,

just a quick guess, might be wrong:

Maybe the error has nothing to do with your recursion, but with improper
scriptlet-braces:

<% com.opencms.flex.jsp.CmsJspActionElement cms = new 
com.opencms.flex.jsp.CmsJspActionElement(pageContext, request,
response);

String uri = cms.getRequestContext().getUri();
try {
listFilesAndFolders(cms, uri);
} catch(Exception e) {


Is'nt here a "%>" missing?



<%= e.getClass().getName() %>
<%= e.getMessage() %>


And a "<%" here ?

}
%>

Frank.


> -----Ursprüngliche Nachricht-----
> Von: opencms-dev-admin at opencms.org 
> [mailto:opencms-dev-admin at opencms.org] Im Auftrag von Nicolas Delsaux
> Gesendet: Donnerstag, 12. Juni 2003 17:00
> An: opencms-dev at opencms.org
> Betreff: [opencms-dev] inclusion loop when using recursive method ?
> 
> 
> Hi, I've written a recursive method for displaying my site 
> hierarchy using 
> <html list. But when I try to use this jsp fragment, lcoated 
> in my elements 
> folder, OpenCms returns an exception, explaining that there 
> is an inclusion 
> loop in my code. Can someone explain me why ?
> Here is that jsp code.
> 
> <%@ page session="false" 
> import="com.opencms.flex.jsp.*,com.opencms.file.*,java.util.*"
>  %><%-- Linagora --%>
> 
> <%!
> public void 
> listFilesAndFolders(com.opencms.flex.jsp.CmsJspActionElement 
> cms, String uri) throws Exception {
> ArrayList files = new ArrayList();
> files.addAll(cms.getNavigation().getNavigationForFolder(uri);
> if(files.size()) > 0) {
> %>
> <ul class="list-files">
> %>
> Iterator iter = files.iterator();
> CmsJspNavElement nav;
> String target;
> while(iter.hasNext()) {
> nav = (CmsJspNavElement) iter.next();
> if(nav!=null) {
> target = nav.getResourceName();
> %><li class="list-files"><%
> if(nav.isFolderLink()) {
> target = cms.link(target + "index.jsp");
> } else { // else if folderLink
> target = cms.link(target);
> } // end if folderLink
> %>
> <a class="list-files" href="<%= target%>"><%= nav.getNavText() %> <%
> if(nav.isFolderLink()) {
> listFilesAndFolders(cms, nav.getResourceName());
> }
> } // end if nav!=null
> } // end while
> %></ul><%
> } // end if size>0
> } // end method
> %>
> 
> <% com.opencms.flex.jsp.CmsJspActionElement cms = new 
> com.opencms.flex.jsp.CmsJspActionElement(pageContext, 
> request, response);
> 
> String uri = cms.getRequestContext().getUri();
> try {
> listFilesAndFolders(cms, uri);
> } catch(Exception e) {
> <%= e.getClass().getName() %>
> <%= e.getMessage() %>
> }
> %>
> 
> -- 
> Nicolas Delsaux
> Bientôt, il y aura ici une signature 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, 
> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> 





More information about the opencms-dev mailing list