From the first link:
There are several Jewish perspectives on this psalm, all of which agree that King David composed it and is the voice throughout, and that it is historical, not messianic. However, they differ on the particulars. The view that is the most consistent with the plain reading of this psalm holds that it is Davids own personal story, in which he describes his own pain, anguish, and longing during those times when he was a fugitive from his enemies, believing that, at times, God had not heeded his pleas for intervention. He pleads with God to come to his aid since his persecutors are relentlessly pursuing him in their zeal to dispossess him of his kingdom and mantle of royalty.
Hmm, being dispossessed of the "mantle of royalty" is expressed as "casting lots" for his vesture?
I'd also found the sencond linked site. Excerpt:
"Unfortunately, I've found it nearly impossible to find commentary on Psalm 22 that doesn't very quickly turn into a debate over this line (JPS):
17 For dogs have encompassed me; a company of evil-doers have inclosed me; like a lion, they are at my hands and my feet.