לִשְׁלֹמֹ֨ה ׀ אֱֽלֹהִ֗ים מִ֭שְׁפָּטֶיךָ לְמֶ֣לֶךְ תֵּ֑ן וְצִדְקָתְךָ֥ לְבֶן־מֶֽלֶךְ׃
為所羅門作。上帝啊,求你將你的公正賜給王,將你的公義賜給王的兒子。
Rashi
Concerning Solomon He prayed this prayer on behalf of his son Solomon, for he foresaw with the holy spirit that he [Solomon] was destined to request of the Holy One, blessed be He, “a heart to understand, to hear judgment.”
Rashi
to a king, etc., to a king’s son Both refer to Solomon. Another explanation: Give Your judgments to a king The chastisements should end with me, and the charity You should bestow upon my son; viz. that there be peace in his days.