<jsp:setProperty name="newsfeed" property="topic" value="news"/>
News headline is <b>${newsfeed.value}</b>.<br/>
<jsp:setProperty name="newsfeed" property="topic" value="entertainment"/>
Entertainment headline is <b>${newsfeed["value"]}</b>.<br/>
<jsp:setProperty name="newsfeed" property="topic" value="weather"/>
The weather in Tokyo right now is ${newsfeed.values.Tokyo}.<br/>
The weather in Mumbai right now is ${newsfeed["values"].Mumbai}.<br/>
The weather in Hong Kong right now is ${newsfeed.values["Hong Kong"]}.<br/>
value = "";
values = null;
if (topic.equals("news")) {
value = "JSP Programmer Won 10 Million in Lottery";
}
if (topic.equals("entertainment")) {
value = "Reality TV Show Ratings Falling";
}
if (topic.equals("weather")){
values = new HashMap();
values.put("Mumbai", "30 C");
values.put("Tokyo", "18 C");
values.put("Hong Kong", "28 C");
}