I want to write the content of a form and the content of the session in a txt file.

When you send the content of the form, I want to do a txt file and write the content of the form and the data of the session.

Is possible to do with a servlet?