The Property Tag
The property tag is used to retrive the data from the ValueStack or some other object in the ActionContext like application or seesion. Let's see how to display the following details using the property tag.
Our Action class AlbumInfoAction contains the following piece of code.
package vaannila;
public class AlbumInfoAction{
private String title;
private Artist artist;
public String populate()
{
title = "Thriller";
artist = new Artist("Michael Jackson","King of pop");
return "populate";
}
public String execute()
{
return "success";
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Artist getArtist() {
return artist;
}
public void setArtist(Artist artist) {
this.artist = artist;
}
}
|