public class Foo extends Properties {
public String getVal(){
return "2";
}
}
In my HttpServlet class' doGet(..) method I am doing this,
Foo foo = new Foo();
request.setAttribute("key", foo);
Then in the .jsp is this code,
1 ${key}
2 ${key.val}
3 <%=request.getAttribute("key")%>
4 <%=((Foo)request.getAttribute("key")).getVal()%>
And this is the output,
1 {}
2
3 {}
4 2
Could anyone tell my why ${key.val} doesn't work?
[Edit] I am only interested on the one property from the foo class, since it seems there is no way to access the getVar() call using EL(Right?), would a viable alternative be to jsut put?
request.setAttribute("key_val", foo.getVal());
Foo is a sub class of a subclass of the Properties class so there is no way for me to decouple them easily.