1

I want some kind of mechanism that will store new generated data in **web.xml** file. Suppose new user is created and I want to store his **username and password (*login credentials*) in web.xml** file at the user creation time then what I ll have to do ? In my system users are also limited in numbers so there is no worry in writing small amount of data in **web.xml** file.

And if possible then I want to write that data in encrypted form in web.xml file. Encryption is later stage but first of all I want to know that how to write dynamically generated data in **web.xml** file ?

And after writing that data to **web.xml**, whenever I need it how can I read that data from **web.xml** ?

I am using Java as Base Language.

Any proper way for to implement it ??

8
  • 1
    Suppose new user is created and I want to store his username and password (login credentials) in web.xml file at the user creation time then what I ll have to do ?, Simply don't do it. That's really weird. Use some database Commented Dec 4, 2013 at 5:48
  • Instead use database with encryption. Commented Dec 4, 2013 at 5:48
  • Ok then will you simply tell me that what to do to write data in web.xml file ? Becuase later time I am going to write some encryption key in it. Commented Dec 4, 2013 at 5:49
  • Any change to a web.xml will also cause the whole web app to reload. Commented Dec 4, 2013 at 5:49
  • @VimalBera - Yes I have tried that one but I also need that to store master key for encryption in web.xml, so I am looking for a way to write data in web.xml. Commented Dec 4, 2013 at 5:51

1 Answer 1

3

Web.xml is a deployment descriptor for your web application, which describes the servlet mappings, welcome pages, etc for your web application. It is not meant for storing transactional data. It is sounding like you do not want a database to store user generated data (logins / passwords / etc ) - instead store it on a filesystem. There are several ways of doing this. For example - if you are using Spring framework - You could use FileSystemResource class to get a handle to a file and perform write / read operations.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.