GithubHelp home page GithubHelp logo

spring-boot-form-handling's Introduction

Spring-Boot-Form-Handling

  • The Spring Boot Application connects to the MySQL server using JPA Repository.

  • JPA Repository offers abstraction for updating , deleting , inserting object into the database. We create a list of objects that gets updated in the database.

  • The functions that can be used are : JPARepository.save() and JPARepository.get().

  • This can be achieved by extending the repository to JPARepository class.

  • src/main/resource/application.properties is used to establish Connection to Database. /spring.datasource.url=jdbc:mysql://localhost:3306/studreg?autoReconnect=true&useSSL=false spring.datasource.username=root spring.datasource.password=pass123 spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.mvc.view.prefix:/WEB-INF/views/ spring.mvc.view.suffix:.jsp/

  • To run the application run com.studentRegistration/StudentRegistrationApplication.java as Java Application.

/*package com.studentRegistration;

import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.support.SpringBootServletInitializer;

@SpringBootApplication public class StudentRegistrationApplication extends SpringBootServletInitializer {
@Override protected SpringApplicationBuilder configure(org.springframework.boot.builder.SpringApplicationBuilder application) { return application.sources(StudentRegistrationApplication.class); }

public static void main(String[] args) {  
			
	SpringApplication.run(StudentRegistrationApplication.class, args);
	
}

} */

  • Once Server Started open browser go to localhost:8080/enrol to initiate application.
  • Data through Jsp forms are recieved by the application through several RequestMappings.
  • StudentRegistrationController.java Class Handled All the page Requests and their corresponding mappings.
  • The RESTful API is done by receiving a set of requests and then send appropriate data back to the request.
  • The API is then compiled into a WAR file using maven, which adds only the dependencies that are used , and ignore the ones that are not specified.
  • Since we have a MySQL Connection established , we need to provide the service in pivotal dashboard.
  • This is done by enabling ClearMySQL Database service by giving an appropriate Instance Name.
  • The API is then hosted on Cloud Foundry by pushing the WAR file to the pivotal dashboard.

To login in Terminal Type cf then follow these commands

cf login -a api.run.pivotal.io To push application cf push studentRegistration -p target\studentRegistration.war To logout cf logout

spring-boot-form-handling's People

Contributors

dependabot[bot] avatar somandra avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

sakshisahu27

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.