| Author |
Confusion, HFSJ Page 385
|
Chandra Bhatt
Ranch Hand
Joined: Feb 28, 2007
Posts: 1707
|
|
Hi, I am not able to grasp the following line of HFSJ page 385: Think about the scenario, if you have a name that's not in quotes in brackets[], that means it MUST adhere to Jana naming rules, right? Here, we're OK, because person is perfectly legal Java variable name. But that's because somewhere, someone said , request.setAttibute("person",p); But the attribute name is a String. Strings dont follpow Java variable name rules. ... ... Please help me! Thanks,
|
cmbhatt
|
 |
swarna dasa
Ranch Hand
Joined: Mar 15, 2007
Posts: 108
|
|
String could be "1234" so you could say request.setAttibute("1234",p); but with dot operator, 1234 is not a valid java identifier, so you cant say pageContext.request.1234 //wrong can say requestScope["1234"] or pageContext.request["1234"]
|
 |
Chandra Bhatt
Ranch Hand
Joined: Feb 28, 2007
Posts: 1707
|
|
Very nice description Swarna! Got it. Thanks,
|
 |
 |
|
|
subject: Confusion, HFSJ Page 385
|
|
|