<%@ include file="doInitPage.jsp" %> <% /** <doc> <name>Documentjsp.jsp</name> <category>System</category> <summary>For a given Jsp provides a summary of different facettes</summary> <history><date>10/08/01 us</date> Gilbert Brault <action> creation</action> </history> <history><date>10/25/01 us</date> Gilbert Brault <action> adapted pharos:foreach switch itCounter to Integer (was int before)</action> </history> <outline> <ul> <li>List of facettes covered <ul> <li>Documentation</li> <li>Directives</li> <li>Anchors</li> <li>Forms</li> <li>Tags (i.e. taglib elements)</li> <li>expressions (in jsp expression)</li> <li>Declarations</li> <li>Local variables</li> <li>method invocations</li> </ul> </li> <li>link to the "skelton view"</li> </ul> </outline> <todo> <ul> <li>cleaning presentation</li> </ul> </todo> <copyright>Schneider-Electric 2001</copyright> </doc> */ %> <% /* Open a jsp file and tries some jspdoc stuff */ ServletContext servletContext = pageContext.getServletContext(); String name = request.getParameter("name"); if (name!=null){ InputStream in = servletContext.getResourceAsStream("/"+name+".jsp"); // dump this ressource if (in!=null){ /* it was a test int c; while ((c = in.read()) != -1){ %> <%= c %> <% } */ com.schneider_electric.ebase.jspdoc.split.PharosDoc pharosDoc = new com.schneider_electric.ebase.jspdoc.split.PharosDoc(in); pharosDoc.parse(); // jsp parsing ArrayList jspDoc = pharosDoc.jspDoc(); pharosDoc.parseHtml(pharosDoc.jspHtml()); ArrayList jspHtmlAnchors = pharosDoc.jspHtmlAnchors(); ArrayList jspHtmlForms = pharosDoc.jspHtmlForms(); ArrayList jspDirectives = pharosDoc.jspDirectives(); ArrayList jspTags = pharosDoc.jspTags(); ArrayList jspExpressions = pharosDoc.jspExpressions(); ArrayList jspDeclarations = pharosDoc.jspDeclarations(); pharosDoc.parseJavaBlob(pharosDoc.jspJavaBlob()); ArrayList jspLocalVariables = pharosDoc.javaBlobLocalVariables(); ArrayList javaBlobExpressions = pharosDoc.javaBlobExpressions(); %>

JSP Documentation: <%= name %>

click to see jsp layout
<%= servletContext.getRealPath("/") %>
<% /* * DOC */ String last=""; if (jspDoc.size()!=0){ %>

Documentation

<% int itCounter = 0; for(Iterator it = jspDoc.iterator(); it.hasNext(); ){ String itjspDoc[] = (String[]) it.next(); itCounter++; %> <% last = itjspDoc[0]; %> <% } %>
<%= (last.equals(itjspDoc[0]))?"":itjspDoc[0] %> <%= ((itjspDoc[0].toLowerCase().equals("outline"))| (itjspDoc[0].toLowerCase().equals("todo")))?itjspDoc[1]:pharosDoc.normalize(itjspDoc[1]) %>
<% } // end if Doc empty %> <% /* * DIRECTIVES */ if (jspDirectives.size()!=0){ %>

Directives

<% int itCounter = 0; for(Iterator it = jspDirectives.iterator(); it.hasNext(); ){ String itjspDirective = (String) it.next(); itCounter++; %> <% } %>
<%= pharosDoc.hyperlink("/documentjsp.jsp?name=" ,pharosDoc.normalize(itjspDirective),true) %>
<% } // end if Directives empty %> <% /* * DECLARATIONS */ if (jspDeclarations.size()!=0){ %>

Declarations

<% int itCounter = 0; for(Iterator it = jspDeclarations.iterator(); it.hasNext(); ){ String itjspDeclaration = (String) it.next(); itCounter++; %> <% } %>
<%= pharosDoc.normalize(itjspDeclaration) %>
<% } // end if Declarations empty %> <% /* * Html Anchors */ if (jspHtmlAnchors.size()!=0){ %>

Anchors

<% int itCounter = 0; for(Iterator it = jspHtmlAnchors.iterator(); it.hasNext(); ){ String itjspHtmlAnchor = (String) it.next(); itCounter++; %> <% } %>
<%= pharosDoc.hyperlink("/documentjsp.jsp?name=" ,pharosDoc.normalize(itjspHtmlAnchor),true) %>
<% } // end if Html empty %> <% /* * Html Forms */ if (jspHtmlForms.size()!=0){ %>

Forms

<% int itCounter = 0; for(Iterator it = jspHtmlForms.iterator(); it.hasNext(); ){ String itjspHtmlForm = (String) it.next(); itCounter++; %> <% } %>
<%= pharosDoc.hyperlink("/documentjsp.jsp?name=" ,pharosDoc.normalize(itjspHtmlForm),true) %>
<% } // end if Html empty %> <% /* * JSPTAGS */ if (jspTags.size()!=0){ %>

JSP TAGS

<% int itCounter = 0; for(Iterator it = jspTags.iterator(); it.hasNext(); ){ String itjspTag = (String) it.next(); itCounter++; %> <% } %>
<%= pharosDoc.normalize(itjspTag) %>
<% } // end if JspTags empty %> <% /* * JavaBloblocalvariables */ if (jspLocalVariables.size()!=0){ %>

Scriptlet Local Variables

<% int itCounter = 0; for(Iterator it = jspLocalVariables.iterator(); it.hasNext(); ){ String itjspLocalVariable = (String) it.next(); itCounter++; %> <% } %>
<%= itjspLocalVariable %>
<% } // end if jspLocalVariable empty %> <% /* * JSPEXPRESSIONS */ if (jspExpressions.size()!=0){ %>

JSP Expressions

<% int itCounter = 0; for(Iterator it = jspExpressions.iterator(); it.hasNext(); ){ String itjspExpression = (String) it.next(); itCounter++; %> <% } %>
<%= pharosDoc.normalize(itjspExpression) %>
<% } // end if JSPEXPRESSIONS empty %> <% /* * Scriptlet expressions including variables */ if (javaBlobExpressions.size()!=0){ %>

Scriptlet expressions

<% int itCounter = 0; for(Iterator it = javaBlobExpressions.iterator(); it.hasNext(); ){ String itjavaBlobExpression = (String) it.next(); itCounter++; %> <% } %>
<%= itjavaBlobExpression %>
<% } // end if Scriptlet Expression empty %> <% // request.getRequestDispatcher("/env.jsp").include(request,response); } else{ // in == null %> There is not such a file <%= name %> <% } } else { // name == null %> usage /documentjsp.jsp?name=<jsp prefix to document>
example: http://<server>/documentjsp.jsp?name=doHeaderHtml <% } %>


SourceForge Logo