This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.mytest.jdbc; | |
| public class Student { | |
| private int id; | |
| private String firstName; | |
| private String lastName; | |
| private String email; | |
| public Student(int id, String firstName, String lastName, String email) { | |
| this.id = id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.luv2code.jsf.hello; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import javax.faces.bean.ManagedBean; | |
| @ManagedBean | |
| public class StudentTwo { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%@ page import="java.util.*" %> | |
| <html> | |
| <body> | |
| <!-- Step 1: Create HTML form --> | |
| <form action="todo-demo.jsp"> | |
| Add new item: <input type="text" name="theItem" /> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.luv2code.springdemo.mvc; | |
| import java.util.LinkedHashMap; | |
| public class Student { | |
| private String firstName; | |
| private String lastName; | |
| private String favoriteLanguage; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| create database if not exists demo; | |
| use demo; | |
| drop table if exists employees; | |
| CREATE TABLE `employees` ( | |
| `id` int(11) NOT NULL AUTO_INCREMENT, | |
| `last_name` varchar(64) DEFAULT NULL, | |
| `first_name` varchar(64) DEFAULT NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package vikram; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.beans.factory.annotation.Qualifier; | |
| import org.springframework.stereotype.Component; | |
| @Component | |
| public class Cast implements employee | |
| { | |
| //Field injection through annotation ensures that there is no need for setter methods to be defined. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.luv2code.springsecurity.demo.config; | |
| import org.springframework.context.annotation.Configuration; | |
| import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; | |
| import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | |
| import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | |
| import org.springframework.security.core.userdetails.User; | |
| import org.springframework.security.core.userdetails.User.UserBuilder; | |
| @Configuration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> | |
| <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <title>Login Page</title> | |
| <meta charset="utf-8"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.luv2code.springdemo.dao; | |
| import java.util.List; | |
| import org.hibernate.Session; | |
| import org.hibernate.SessionFactory; | |
| import org.hibernate.query.Query; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.stereotype.Repository; | |
| import org.springframework.transaction.annotation.Transactional; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>spring-hibernate-for-beginners</groupId> | |
| <artifactId>spring-demo-app</artifactId> | |
| <version>1.0.0</version> | |
| <packaging>jar</packaging> | |
| <properties> | |
| <springframework.version>5.0.2.RELEASE</springframework.version> |