I have a question that is of interest to me. Suppose I have a class definition like this:
public class A extends DumbAction{ public class B {
The compiler does not seem to prohibit such code. Therefore, I pass to the HttpServletRequest instance a list of instances of the inner class. But then I try to access their public methods in the JSP, I get a complaint that there are no such reading methods (like getName). Although the objects themselves seem to exist.
What does it mean? That inner classes cannot be passed into the outside world even implicitly? Or does their life end immediately as an instance of the outer class ceases to exist? Or that no one can access the public methods of the inner class except the outer.
Upd: here is a fragment of a jsp page that uses a list of instances of the inner class:
<c:forEach var = "element" items = "${list}"> <c:out value = "${element.name}"/><br/> </c:forEach>
It seems that forEach is working fine, but cannot access the public method getName () of the inner class according to the JSTL.
source share