A hydrophilic biocompatible polymer, N-glycidyl histidine ether, was synthesized and self-assembled after complexation with tannic acid to form unique toroidal-like capsules, which when coated on a urinary catheter significantly reduce the association of urinary pathogens and inhibit biofilm formation. Thus, the coated catheter is effective for long-term use and hinders catheter-associated infections.