It is entirely possible and I build all my grinders this way. The key is to place the cactus one block above the water and use diagonal flows. This is a picture of the grinder of my main mob trap, but this design is also suitable for installing in one corner of a dungeon wall to grind on a mob spawner (especially if you mine the floor of all mossy and plain cobblestone, leaving a slot perfect for the water flow).

Mobs are pushed against the sand block by the water. Once they randomly jump up and stand on the sand block, they are eventually killed by the cactus. Their drops then usually land in the water below. The water's flow splits evenly around the sand block and rejoins at the other side where the flow goes to the collection point.
Restricting the cactus to be two blocks high as in this image means that the grinder also generates a modest supply of cactus blocks.
Originally, I stood at the point where the flows rejoin to collect items, but a creeper somehow blew up the trap while I was AFK, and I had problems with chickens pushing me out of the collection area, so I now have the items carried some distance away in an aqueduct.
This particular installation is for my main mob grinder, so besides the cactus there is also a fatal drop from above; the cactus here is merely to kill the ones that the water saves from instant death.
You can visit this trap and my other cactus traps at my Minecraft server at switchb.org.