I have never had a big reason to make a jail in a fortress before, usually I don't have any trouble until the fortress is big enough that I can afford to just hire a guard and have them beat the crap out of unruly dwarves. However, in my most recent fortress half of every migrant wave comes in miserable and starts tantruming upon arrival (it seems to be due to proximity to a necromancer tower or evil biome, they all say they were attacked by the dead). And in .40, it appears that breaking things and kicking animals while tantruming is punishable by dwarven justice, which makes everyone happier knowing unruly dwarves are being punished (and as a result helping to stop tantrum spirals). Thus far we have two dwarves in restraints and about 6 in the hospital, some of which may be from beatings, but are mostly from tantrum victims getting their toes stomped on or something.
Right now I just have a few ropes tied next to my food stores to make sure the prisoners don't die (and a hospital on the next floor to help the injured). What's the best way to make a jail? Maybe dropping dog corpses on them to desensitize them since they can't run, or putting wooden spear spike traps to make them train dodging while they wait for their sentence to end?
Keep in mind, this isn't dwarven daycare, these are citizens who will resume work once they are released. As a result, if it makes them go insane or die, it's a bad plan.