This file contains 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
<!DOCTYPE html> | |
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%> | |
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %> | |
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> | |
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> | |
<c:url var="rootURL" value="/"/> | |
<html> | |
<head> | |
<title>Login</title> | |
<link href="${rootURL}resources/bootstrap/css/bootstrap.css" media="screen" rel="stylesheet" type="text/css" /> |
This file contains 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
<h3>Email: <sec:authentication property="name"/></h3> | |
<h3> | |
<sec:authorize access="hasRole('ROLE_ADMIN')"> | |
<a href="admin">Administration</a> | |
</sec:authorize> | |
</h3> | |
<p> <a href="logout">Logout</a></p> | |
</body> |
This file contains 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
<dependency> | |
<groupId>org.springframework.data</groupId> | |
<artifactId>spring-data-jpa</artifactId> | |
<version>1.5.0.RELEASE</version> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.data</groupId> | |
<artifactId>spring-data-rest-webmvc</artifactId> | |
<version>2.0.0.RELEASE</version> |
This file contains 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
@Entity | |
@Table(name = "USERS") | |
public class User implements Serializable | |
{ | |
private static final long serialVersionUID = 1L; | |
@Id | |
@GeneratedValue(strategy = GenerationType.IDENTITY) | |
@Column(name = "user_id") | |
private Integer id; |
This file contains 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.sivalabs.springdatarest.web.config; | |
import javax.servlet.Filter; | |
import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; | |
import org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter; | |
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; | |
import com.sivalabs.springdatarest.config.AppConfig; |
This file contains 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
public interface UserRepository extends JpaRepository<User, Integer> | |
{ | |
} | |
public interface RoleRepository extends JpaRepository<Role, Integer> | |
{ | |
} | |
public interface ContactRepository extends JpaRepository<Contact, Integer> |
This file contains 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
{ | |
"_links": { | |
"self": { | |
"href": "http://localhost:8080/spring-data-rest-demo/rest/users/{?page,size,sort}", | |
"templated": true | |
}, | |
"search": { | |
"href": "http://localhost:8080/spring-data-rest-demo/rest/users/search" | |
} |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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>com.sivalabs</groupId> | |
<artifactId>hello-angularjs</artifactId> | |
<version>1.0-SNAPSHOT</version> |
This file contains 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.sivalabs.app.entities; | |
@Entity | |
public class Todo { | |
@Id @GeneratedValue(strategy=GenerationType.AUTO) | |
private Integer id; | |
private String description; | |
@Temporal(TemporalType.TIMESTAMP) | |
private Date createdOn = new Date(); | |
//setters and getters |