How do affixes work in Diablo 2?

Solution 1:

All items can have the affixes you want provided that their ilvl is high enough to hold that affix.

In your specific example, the Spearmaiden's affix (a +2 to javelin and spear skills prefix) can appear on Gloves and Spears above an ilvl of 40 regardless of type of glove/spear. Alacrity (a 20% Increased Attack Speed suffix) requires gloves with an ilvl of 43. So what you want to do is be in an area with a minimum lvl of 43 (generally end of a1 nightmare and on) to ensure all the rare gloves in that area has a chance of dropping with those 2 modifiers.

You typically want to pick up all the gloves, but you may not want to wear some of the ones that have high str requirements depending on your build.

Magic items can have at most 1 prefix + 1 suffix, rares can have up to 3 prefixes and 3 suffixes.

One last thing, there are some suffix/prefix mods that can only appear on magic items. For example, a pair of magic gloves can roll with the Lancer's prefix (+3 javelin) instead of +2.