My reading of scripture admonishes against taking revenge, which is separate from seeking justice. If someone harms you it is appropriate to seek recompense and to have a transgressor punished. It is extremely difficult, even for a wise person, to see the line between punishment and revenge which is why we have judges set sentences or determine compensation instead of victims.
Do not gloat...