Skip to main content

04/07/2019_Week2_Thursday

Serving Web Content with Spring MVC

ref: https://spring.io/guides/gs/serving-web-content/#initial

This task was done. Name attribute was given and changed  , so that the when the name is changed it will be displayed

Handling Form Submission

ref: https://spring.io/guides/gs/handling-form-submission/

Steps done

  1. Created the relevent directories manually
  2. added the pom.xml file
    1. Parent as spring-boot-starter-parent version 2.1.6.RELEASE
    2. Inserted the dependencies
      1. spring-boot-starter-web
      2. spring-boot-starter-thymeleaf (usage of thymeleaf as a java based library was not recommended.Using JSP and JSTL is better.)
    3. plugins
      1. spring-boot-maven-plugin
  3. Made java files.
    1. GreetingController.java  (Where the GET and POST mapping is done)
    2. Greeting.java  (ids setters and getters)
    3. Application.java (Application starting place)
  4. Made the .html files
    1. greeting.html (where the submission happens)
    2. result.html (where the displaying happens)
  5. Making application Excutables
    1. mvn clean package
    2. java -jar target/gs-handling-form-submission-0.1.0.jar

Handling Form Submission with

What we were doing was using spring boot..The previous examples were based on spring boot
https://www.mkyong.com/spring3/spring-3-mvc-hello-world-example/







Comments

Popular posts from this blog

Hackerank Q&A

HACKERANK SQL PROBLEMS. Question: Generate the following two result sets: Query an  alphabetically ordered  list of all names in  OCCUPATIONS , immediately followed by the first letter of each profession as a parenthetical (i.e.: enclosed in parentheses). For example:  AnActorName(A) ,  ADoctorName(D) ,  AProfessorName(P) , and  ASingerName(S) . Query the number of ocurrences of each occupation in  OCCUPATIONS . Sort the occurrences in  ascending order , and output them in the following format: There are a total of [occupation_count] [occupation]s. where  [occupation_count]  is the number of occurrences of an occupation in  OCCUPATIONS  and  [occupation]  is the  lowercase  occupation name. If more than one  Occupation  has the same  [occupation_count] , they should be ordered alphabetically Answer:   select ( case when occupation= "Doctor" then concat( name ...

git

git is a useful platform for software project management where it gives you speed and efficiency when handling larger or smaller projects. git keeps track of your workflow and editing ,branching , merging and debugging the code is granted to different users. git config git config –global user.name “[name]” git config –global user.email “[email address]” git init  initiates git git clone clones git project to the current directory git add adding files to the staging area. git commit git commit -m “[ Type in the commit message]” records the files in the staging area permanently in the history git diff shows the files differences which are not yet staged git diff –staged This command shows the differences between the files in the staging area and the latest version present. git diff [first branch] [second branch] git commit -a This command commits any files you’ve added with the git add command and also commits any files you’ve changed since ...

10-09-2019_Week3-Wednesday

Creating a WebAPP of Movies to show Actors and movies Home Page Tabs Movies Actors. Buttons Add movie > movie submit Form Add actor > Actor submit Form Databases/Submit Forms Movies Name Year Genere Actors Description Image Actors Name fname last name  Date of birth  Description