https://www.zkoss.org/_w/index.php?title=Sample_code_for_el_access_java_bean&feed=atom&action=historySample code for el access java bean - Revision history2024-03-29T15:37:37ZRevision history for this page on the wikiMediaWiki 1.35.1https://www.zkoss.org/_w/index.php?title=Sample_code_for_el_access_java_bean&diff=3559&oldid=prevChar: Created page with ' {{ZKDevelopersGuidePageHeader}} In the following example, you can see how EL can access property of java bean. The zul, <source lang="xml" > <window> <zscript> Person perso…'2010-07-23T03:09:49Z<p>Created page with ' {{ZKDevelopersGuidePageHeader}} In the following example, you can see how EL can access property of java bean. The zul, <source lang="xml" > <window> <zscript> Person perso…'</p>
<p><b>New page</b></p><div><br />
{{ZKDevelopersGuidePageHeader}}<br />
<br />
In the following example, you can see how EL can access property of java bean.<br />
<br />
The zul,<br />
<source lang="xml" ><br />
<window><br />
<zscript><br />
Person person = new Person();<br />
person.setFirstName("Tom");<br />
person.setLastName("Hanks");<br />
</zscript><br />
First name is :${person.firstName}<br />
Last name is :${person.lastName}<br />
Full name is :${person.fullName}<br />
</window><br />
</source><br />
<br />
And the java file, Person.java<br />
<source lang="java" ><br />
public class Person {<br />
private String _firstName = "";<br />
private String _lastName = "";<br />
<br />
// getter and setters<br />
public void setFirstName(String firstName) {<br />
_firstName = firstName;<br />
}<br />
<br />
public String getFirstName() {<br />
return _firstName;<br />
}<br />
<br />
public void setLastName(String lastName) {<br />
_lastName = lastName;<br />
}<br />
<br />
public String getLastName() {<br />
return _lastName;<br />
}<br />
<br />
public void setFullName(String f) {<br />
// do nothing.<br />
}<br />
<br />
public String getFullName() {<br />
return _firstName + " " + _lastName;<br />
}<br />
}<br />
</source><br />
<br />
<br />
{{ ZKDevelopersGuidePageFooter}}</div>Char