Skip to content

Instantly share code, notes, and snippets.

View sivaprasadreddy's full-sized avatar
:octocat:
Learning and practicing...

K. Siva Prasad Reddy sivaprasadreddy

:octocat:
Learning and practicing...
View GitHub Profile
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)
@sivaprasadreddy
sivaprasadreddy / RESTEasy-Maven-POM.xml
Created June 6, 2012 14:57
RESTEasy Maven Configuration
<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>
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;
<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>
@sivaprasadreddy
sivaprasadreddy / index-links.html
Created September 5, 2014 12:17
index-links.html
@sivaprasadreddy
sivaprasadreddy / contacts-1.html
Created September 5, 2014 12:17
contacts-1.html
<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>
@sivaprasadreddy
sivaprasadreddy / app-1.js
Created September 5, 2014 12:16
app-1.js
var myApp = angular.module('myApp',['ngRoute']);
myApp.config(['$routeProvider','$locationProvider',
function($routeProvider, $locationProvider) {
$routeProvider
.when('/home', {
templateUrl: 'templates/home.html',
controller: 'HomeController'
})
.when('/contacts', {
@sivaprasadreddy
sivaprasadreddy / Contact-Service-Ctrl.js
Created September 5, 2014 12:15
Contact-Service-Ctrl.js
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;
@sivaprasadreddy
sivaprasadreddy / Contact-Entity-Repo-Ctrl.java
Created September 5, 2014 12:14
Contact-Entity-Repo-Ctrl.java
@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;
@sivaprasadreddy
sivaprasadreddy / TodoController-1.js
Created September 5, 2014 12:14
TodoController-1.js
myApp.controller('TodoController', [ '$scope', 'TodoService', function ($scope, TodoService) {
$scope.newTodo = {};
$scope.loadTodos = function(){
TodoService.loadTodos().
success(function(data, status, headers, config) {
$scope.todos = data;
})