The present invention provides a liquid polymer composition which can be implanted into a living mammal and which forms a solid hydrogel by in situ polymerization upon contact with body fluid and tissue. The composition also can be used as a coating on a medical device, or for the formation of a medical device. Formation of a solid implant or coating involves crosslinking of the adhesive with itself and with surrounding tissue. The liquid implant, by itself or in conjunction with various prostheses, can be used for many purposed, including fixation of the urethra for providing treatment for incontinence, and repair of herniations in the abdominal cavity, including rectocele, cystocele, enterocele, and inguinal hernia. The adhesive may be used to establish adhesion prevention during such repairs, in part by coating or being the material of a repair mesh.