SpringProyectDemo3
Autor: Daniel Pérez Pérez
Fecha: 25/08/2022
Demonstration of implementation of the Spring Security module in the context of MVC web spring.
Note: The org.springframework. So to execute this project you must do it with Apache Tomcat 9 since Apache Tomcat 10 implements the new Jakartaee structure.
If you want to create web applications with Spring about Apache Tomcat 10 it is better that you use Spring Boot. (Locate my repositories on web applications with Spring Boot 3).
Development Environment: Eclipse, Version: 2022-03 (4.23.0) Server: Apache Tomcat, Version: 9 JDK: OpenJDK, Version: 17.1 Project Manager: Maven, Version: 3.8.0 Maven artifact id
Spring Framework: Web Spring MVC V.5.3.22
Javax Servlet: V.4.0.1 JSTL: Version: V.1.2 Spring Security Web: V.5.7.3
Spring Security Conf: V.5.7.3
Spring Security Taglibs: V.5.7.3
1st. Copy the Board of Directors with the Code in the Board of Directors of your Eclipse Work Space. 2nd. From eclipse, import the project by clicking on File -> Open Projects from File System 3rd. In Import Source, clicking on the "Directory ..." button select the folder that contains the project. 4th. Click on Finish 5th. It is recommended to make a maven update (right click on the MAVEN -> Update Project ...
For the analysis of this project, it is recommended to follow the following order, which almost coincides with the order that has been followed to configure and implement this project and then indicated:
1st Creation of the Maven Project with Artigact ID: Maven-Archetype-Webapp (and elimination of the .JSP file that appears by default).
2nd Modification of the Pom.xml file - Adapt the version of the JDK by modifying and establishing the Maven.compiler.Source and Maven.compiler.target. Spring-Security-Config. -Add the Javax.Servlet-Api, Spring-Webmvc, JSTL, Spring-Security-Web, Spring-Security-Config, Spring-Security-Taglibs-(Forcing a Maven Update Project to import the units).
3rd Modification of the Web.XML deployment file by adding the DEN Servlet configuration that will execute the main spring container and indication of the .XML of the Spring container configuration relative to user requests (session-conntext.xml). Note that the version of the web.xml scheme is the 4.0 which must coincide with the version of the Dinamic Web Project facet on project properties. Check that in the Project Projects the Dinamic Web version Sea 4.0 version and in Java Build Path Figure Maven's units as a check.
4th creation of the /Web-inf/session-context.xml file containing the Spring container configuration.
5th creation of resources directories:/SRC/MAIN/webapp/IMG,/SRC/Main/Webapp/Styles and/SRC/Main/Webapp/Web-Inf/Views and its resources.
6th Spring Security Configuration: - Creation of the Securityappinicalize.java class
7th Overload of login events when creating the authenticationvents.java class
8th creation of the classes contained in the ES.DSW.Controllers package
Note: Analyze each of the examples provided in this project.