Monthly Archives: December 2023

SPRING MVC THE PERSISTENCE LAYER

CREATION OF THE WEB APP PERSISTENCE LAYER We will now see, after creating the first domain class, how to create the persistence layer. We are going to create specific interfaces that provide methods, which are normally CRUD operations, that is, create, read, update and delete on the database. Once the interfaces are created, we will create the classes that implement them, which will have a fundamental notation, @Repository never to be forgotten in order to avoid Spring MVC errors. We create a new package, com.xantrix.webapp.repository. Since we have implemented the Articoli domain class, it is clear that the first interface [...]

By |2023-12-05T22:51:15+00:00December 5, 2023|0 Comments

SPRING MVC THE ARTICLES CONTROLLER

CREATION OF ARTICLE CONTROLLER CLASS The controller handles requests arriving at the Dispacher Servlet. We create a new class ArticoliController.java, which will handle all calls involving articoli. We insert the @Controller notation critical to the IOC and to the Dispacher Servlet that when it goes to look for the appropriate controllers, it will know that this is a Controller class. THE @REQUESTMAPPING NOTATION The notation @RequestMapping("/articoli") stands for the fact that all calls that will involve articoli should have in the URL the slash / followed by the word articoli. Let's look at the code or [...]

By |2023-12-14T04:28:11+00:00December 12, 2023|0 Comments

SPRING MVC THE PROJECT FOR MYSQL

STORE PROCEDURE SECURITY THE RISKS OF SQL INJECTION The flexibility and ease of store procedures pays off in terms of security. We have created a flexible and dynamic system but one that exposes us to what is called Sql Injection, a much feared hacker attack technique. One way to reduce this risk is to decrease the number of parameters that are passed in. Another way to avoid malicious code is to minimize the permissions of the user using the Store Procedure. When we set up the user accessing the database we gave db_owner permissions, this is fine for a [...]

By |2023-12-22T21:35:58+00:00December 17, 2023|0 Comments

SPRING MVC THE DATA BINDER

THE DATA BINDER IN SPRING MVC Before analyzing the binder via the input form, let us again make some important considerations. We again introduce what is the fundamental pattern of Spring MVC. We have seen how the different layers that make up its architecture allow us to get information compatible with our browsers, starting with the data within the DBMS.Then going through the persistence and service layer where if necessary, being the Business Logic layer, they undergo changes. We then get to the presentation layer which thanks to the Controller is exchanging this data in a [...]

By |2023-12-26T21:16:34+00:00December 26, 2023|0 Comments
Go to Top