Can JSP EL do direct attribute access

It really surprised me! I have the following code in my JSP.

<c:param name="title" value="${slideShow.title}" />

This code worked until I processed the SlideShow class and made all the attributes public and remote getters / setters. Therefore, it seems to me that EL only works with getter, and not with direct access to attributes. It's true? Is there a way to make it work with direct attributes instead of going through getters?

+3
source share
1 answer

JSP EL is strictly dependent on the Java Bean specification, so it cannot use other conventions to access property values.

Actually, you can read about it fooobar.com/tags/el / ...

, - ( ), EL vesion:

EL 2.2, Servlet 3.0/JSP 2.2 (Tomcat 7, Glassfish 3, JBoss AS 6 ..), -.

. ${ bean.find(param.id)}

public Something find(String id) {
    return someService.find(id);
}
+4

All Articles