This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[NB5.5 20061002, JDK 1.505] I'm not sure if I had reported this circa nb4, but I could not find it by query. One could believe this is a feature than a bug. But it is a bugging (absence of) feature. In the following JSP, pressing [ctrl-space], with cursor after "iterx." code- completion pop-up does not contain the public classes of inner class IterX. ========================================================================== <%@ page import=" java.util.Iterator, org.jdom.Element, org.jdom.Attribute", "org.jdom.input.SAXBuilder" %> <% String x = request.getParameter("x"); java.util.List contents = null; class IterX { public void iterate (Element ei, JspWriter out) throws java.io.IOException { Iterator iter = ei.getChildren().iterator(); iterate(iter,out); } public void iterate (Iterator iter, JspWriter out) throws java.io.IOException { while (iter.hasNext()) { Object oj = iter.next(); if (oj==null )continue; if (oj instanceof Element) { Element ej = (Element) oj; %> <% %><%=ej.getName()%>:<%=ej.getText().replaceAll("[\n\r ]+", "")% ><% iterate(ej.getAttributes().iterator(), out); iterate(ej,out); } else if (oj instanceof Attribute) { Attribute aj = (Attribute) oj; %> <% %>+ <%=aj.getName()%>:<%=aj.getValue()%><% } } } } if (fistx!=null) { String xpath = session.getServletContext().getRealPath("/WEB-INF/"+x); String xfile = new File(xpath); SAXBuilder saxb = new SAXBuilder(); saxb.setValidation(true); Document xdoc = saxb.build(xfile); IterX iterx = new IterX(); iterx.iterate(xdoc.getRootElement(), out); } %>
if (fistx!=null) should have been if (x!=null)
and imports should have been, <%@ page import=" java.util.Iterator, org.jdom.Element, org.jdom.Attribute, org.jdom.input.SAXBuilder" %>
Notice Issue 88539.
This does not a legal JSP - inner classes can be only declared within JSP declarations <@! ... @>. Note that using inner classes defined in JSP is a terrible programming practice, JSP scriptlets as such are discouraged, the more logic they contain the worse.
I think you meant, <%! ... %>. Anything is legal to me as long as java and jsp permits it.