This content has been marked as final.
Show 1 reply
-
1. Re: ${variable.member} does not work!
c-e Oct 2, 2006 2:54 PM (in response to c-e)Hi, I found the riddle's solution:
But could anybody tell how to access _jspService's objects via ${object.member}? Is it possible, at all? (Although, I don't think it's necessary.)
Thanks, Christian
<%! public class Test {
private int number;
public int getNumber() { return number; }
protected void setNumber(int number) { this.number = number; }
}
%>
<%
Test local = new Test();
local.setNumber(3);
pageContext.setAttribute("local", local);
application.setAttribute("global", local);
%>
${local.number}
${global.number}
Problem A)
- it seems, that ${object.member} can't access the objects in the _jspService() method
- but it searches the pageContext object
Problem B)
- class must be public
(the error message -- it just says "public", nothing specific)