Home>

I am writing a small project in Spring, there is a main login page, where, if the user is entered correctly, it is redirected to the welcome page.

My question is -how can I get the data entered by the user in order to operate on them further by implementing certain logic? The fact is that in addition to the username and password, there are several more fields and it is the data from them that I want to receive for verification

There is no database in the project, the correct username and password are in application.properties

  • Answer # 1

    The easiest way for a test project to make some kind of class to store such data class Storage { public static Map < String, Object > data= new HashMap < > (); }

    Well, store your data there. At the time of the request, just put something there and take it out at the right time Strorage.data.put ("Field1", "Here some data"); Storage.data.get ("field1");

  • Answer # 2

    The easiest way for a test project to make some kind of class to store such data class Storage { public static Map < String, Object > data= new HashMap < > (); }

    Well, store your data there. At the time of the request, just put something there and take it out at the right time Strorage.data.put ("Field1", "Here some data"); Storage.data.get ("field1");