Skip to content

Instantly share code, notes, and snippets.

@gomzie
gomzie / userDetails.jsp
Created September 9, 2012 07:13
userDetails.jsp
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c' %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<html>
<head>
</head>
<body>
<table>
<tr>
<td>Name</td>
@gomzie
gomzie / createUser.jsp
Created September 9, 2012 07:13
createUser.jsp
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c' %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<html>
<head>
</head>
<body>
<div id='createUser'>
<form:form commandName="user" action="userDetails">
<fieldset>
@gomzie
gomzie / User.java
Created September 9, 2012 07:12
User.java
package org.spring.mongo;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;
@Document
public class User {
@Id
@gomzie
gomzie / Role.java
Created September 9, 2012 07:09
Role.java
package org.spring.mongo;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
@Document
public class Role {
@Id
private String id;
@gomzie
gomzie / UserService.java
Created September 9, 2012 07:08
UserService.java
package org.spring.mongo.service;
import java.util.List;
import java.util.UUID;
import com.sage.videosub.User;
import com.sage.videosub.repository.RoleRepository;
import com.sage.videosub.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@gomzie
gomzie / VideoSubScontroller.java
Created September 9, 2012 07:08
VideoSubScontroller.java
package org.spring.mongo.controller;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.sage.videosub.Role;
@gomzie
gomzie / web.xml
Created September 9, 2012 07:04
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>VideoSub</display-name>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>spring</servlet-name>
@gomzie
gomzie / trace-context.xml
Created September 9, 2012 07:03
trace-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd">
@gomzie
gomzie / spring-data.xml
Created September 9, 2012 07:02
spring-data.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
@gomzie
gomzie / spring.properties
Created September 9, 2012 07:02
spring.properties
# database properties
mongo.db.name=videosub
mongo.host.name=localhost
mongo.host.port=27017