简体   繁体   中英

How to write dynamic data in web.xml file?

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 ??

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM