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.resteasydemo; | |
import java.util.Date; | |
import javax.xml.bind.annotation.XmlAccessType; | |
import javax.xml.bind.annotation.XmlAccessorType; | |
import javax.xml.bind.annotation.XmlRootElement; | |
@XmlRootElement | |
@XmlAccessorType(XmlAccessType.FIELD) |
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/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.sivalabs</groupId> | |
<artifactId>resteasy-demo</artifactId> | |
<version>0.1</version> | |
<packaging>war</packaging> |
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.resteasydemo; | |
import java.util.List; | |
import org.jboss.resteasy.client.ClientRequest; | |
import org.jboss.resteasy.client.ClientResponse; | |
import org.jboss.resteasy.util.GenericType; | |
import org.junit.Assert; | |
import org.junit.Test; |
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
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee | |
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" | |
id="WebApp_ID" version="3.0"> | |
<listener> | |
<listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class> | |
</listener> |
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
<div class="container"> | |
<div class="row"> | |
<div class="col-md-3 sidebar"> | |
<div class="list-group"> | |
<a href="#home" class="list-group-item"> | |
<i class="fa fa-home fa-lg"></i> Home | |
</a> | |
<a href="#contacts" class="list-group-item"> | |
<i class="fa fa-user fa-lg"></i> Contacts | |
</a> |
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
<table class="table table-striped table-bordered table-hover"> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Email</th> | |
</tr> | |
</thead> | |
<tbody> | |
<tr ng-repeat="contact in contacts"> | |
<td>{{contact.firstname + ' '+ (contact.lastname || '')}}</td> |
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
var myApp = angular.module('myApp',['ngRoute']); | |
myApp.config(['$routeProvider','$locationProvider', | |
function($routeProvider, $locationProvider) { | |
$routeProvider | |
.when('/home', { | |
templateUrl: 'templates/home.html', | |
controller: 'HomeController' | |
}) | |
.when('/contacts', { |
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
myApp.service('ContactService', ['$http',function($http){ | |
this.getContacts = function(){ | |
var promise = $http.get('contacts') | |
.then(function(response){ | |
return response.data; | |
},function(response){ | |
alert('error'); | |
}); | |
return promise; |
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 | |
public class Person implements Serializable | |
{ | |
private static final long serialVersionUID = 1L; | |
@Id @GeneratedValue(strategy=GenerationType.AUTO) | |
private Integer id; | |
private String email; | |
private String password; | |
private String firstname; | |
private String lastname; |
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
myApp.controller('TodoController', [ '$scope', 'TodoService', function ($scope, TodoService) { | |
$scope.newTodo = {}; | |
$scope.loadTodos = function(){ | |
TodoService.loadTodos(). | |
success(function(data, status, headers, config) { | |
$scope.todos = data; | |
}) |