Giter VIP home page Giter VIP logo

sprint5_t1_springboot_web_app_crud_mysql's Introduction

Sprint5_T1_Spring Boot_Web_App_CRUD_MySQL

We have an entity called Branch, which has the following properties:

- Integer pk_BranchID - String nameBranch - String countryBranch

We also have a DTO called BranchDTO, which will have the same properties as the Branch entity, adding one:

- String typeBranch.

This property, depending on the country of the branch, must indicate whether it is "EU" or "Non-EU". To do this, you can have a private list in the same DTO (for example: List countries), with the countries that are part of the EU.

Leveraging the JPA specification, you will need to persist the Branch entity to a MySql database, following the MVC pattern.

The advice is that you use BranchDTO in the Controller and the View, and Branch in the Repository. The service layer will be in charge of translating between the two. For this, depending on the main package, you will create a package structure, where you will place the classes you need:

- cat.itacademy.barcelonactiva.cognoms.nom.s05.t01.n01.controllers - cat.itacademy.barcelonactiva.surnames.nom.s05.t01.n01.model.domain - cat.itacademy.barcelonactiva.surnames.nom.s05.t01.n01.model.dto - cat.itacademy.barcelonactiva.surnames.nom.s05.t01.n01.model.services - cat.itacademy.barcelonactiva.cognoms.nom.s05.t01.n01.model.repository

The class located in the controllers package (SucursalController, for example), must be able to respond to the following requests to update and consult information:

http://localhost:9000/branch/add http://localhost:9000/branch/update http://localhost:9000/sucursal/delete/{id} http://localhost:9000/sucursal/getOne/{id} http://localhost:9000/branch/getAll

As you can see, in the application.properties file, you must configure that the port to be used is 9000.

The view must be developed with Thymeleaf.

In order to make it more attractive, you can optionally use a CSS library that makes it easier for you, such as bootstrap, tailwind, material, etc.

Very important:

In addition to the Git link for the solved assignment, you must include at least two links, other than the resources we have provided you with on campus, that have helped you, or could have helped you, in solving the entire assignment or some parts.

sprint5_t1_springboot_web_app_crud_mysql's People

Contributors

plopezgit avatar

Watchers

 avatar

sprint5_t1_springboot_web_app_crud_mysql's Issues

error when editing a branch

given the user is editing a branch
when click on edit
then the system shows:

url: http://localhost:9000/views/branch/;jsessionid=6D5D2822D8AD7A1F487C9C9011259191

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Sat Jan 13 20:50:14 CET 2024
There was an unexpected error (type=Not Found, status=404).
No static resource views/branch/.
org.springframework.web.servlet.resource.NoResourceFoundException: No static resource views/branch/.
	at org.springframework.web.servlet.resource.ResourceHttpRequestHandler.handleRequest(ResourceHttpRequestHandler.java:585)
	at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:52)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:903)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:564)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:340)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:1623)

n1Exe1

  • import maven project settings
  • entity/domain creation
  • project package structure including view
  • bootstrap resources
  • using template applying thymeLeaf
  • add validation
  • creating DTO
  • QA

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.