This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Property Vs Attribute

 
Rajagopalan Rajendran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pals,

I am preparing for the SCWCD.
I have doubt regarding the two versions of <C:set>

one is for attributes
<c:set var="Gopal" value="SCWCD" />

and the other for the Bean (Properties) or Map(Map Keys)
<c:set target="${Gopal1}" property="SUN" value="SCWCD" />

Now i got confused between the attributes and Properties.

Now if i am correct in JSP tags
we use the getProperty for those scripting to replace getattribute

can anyone explain me the difference ...

thanks .........
 
shiva viswanathan
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gopal ,

No , getProperty is not exactly to getAttribute

If you look at the syntax of getProperty you specify a bean name then
the corresponding property which you want to access

<c:set var="Gopal" value="SCWCD" />

is used to setting the value of an attribute called Gopal with value "SCWCD"
which is present in the appropriate scope (in this case pageScope )

<c:set target="${Gopal1}" property="SUN" value="SCWCD" />

is used to set the Property called SUN for an attribute called Gopal1
which is already present in one of the scope ( in this case again pageScope)

First case you are setting an atribute's value

Second case you are setting an attribute's property's value

Hope this clarifies everything

Catch You Later
Shiva
 
Rajagopalan Rajendran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Shiva .
Yes i got it.
i was pretty confused when i read that, now i am clear about that.
thanks a lot !!
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic