Skip to content

Instantly share code, notes, and snippets.

@krams915
krams915 / connect.html
Created December 8, 2012 06:02
Spring Social Twitter connect.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../../resources/css/style.css" th:href="@{/resources/css/style.css}" />
<title th:text="#{connect.title.tw}">Title</title>
</head>
@krams915
krams915 / connect.html
Created December 8, 2012 06:02
Spring Social Facebook connect.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../../resources/css/style.css" th:href="@{/resources/css/style.css}" />
<title th:text="#{connect.title.fb}">Title</title>
</head>
@krams915
krams915 / profile.html
Created December 8, 2012 06:01
Spring Social Twitter profile.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<head th:fragment="header">
<meta charset="utf-8" />
<link rel="stylesheet" href="../../../resources/css/style.css" th:href="@{/resources/css/style.css}" />
<title th:text="#{'profile.title.' + ${source}}">Title</title>
</head>
@krams915
krams915 / profile.html
Created December 8, 2012 06:00
Spring Social Facebook profile.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<head th:fragment="header">
<meta charset="utf-8" />
<link rel="stylesheet" href="../../../resources/css/style.css" th:href="@{/resources/css/style.css}" />
<title th:text="#{'profile.title.' + ${source}}">Title</title>
</head>
@krams915
krams915 / messages_en.properties
Created December 8, 2012 05:58
Spring Social messages_en.properties
app.name=TestApp
#login.html
login.title=Sign in
login.legend=Sign in
login.username=Username
login.password=Password
login.button=Sign in
login.noaccount=No account? Create one now!
@krams915
krams915 / spring.properties
Created December 8, 2012 05:58
Spring Social spring.properties
# database properties
app.jdbc.driverClassName=com.mysql.jdbc.Driver
app.jdbc.url=jdbc\:mysql\://localhost/spring_social_tutorial
app.jdbc.username=root
app.jdbc.password=
# social properties
facebook.clientId=YOUR-FACEBOOK-CLIENT-ID
facebook.clientSecret=YOUR-FACEBOOK-CLIENT-SECRET
twitter.consumerKey=YOUR-TWITTER-CONSUMER-KEY
@krams915
krams915 / spring-security.xml
Created December 8, 2012 05:56
Spring Social spring-security.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd
@krams915
krams915 / SecurityConfig.java
Created December 8, 2012 05:52
Spring Social SecurityConfig.java
package org.krams.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.web.filter.DelegatingFilterProxy;
@Configuration
@ImportResource({"classpath:spring-security.xml"})
public class SecurityConfig {
@krams915
krams915 / ThymeleafConfig.java
Created December 8, 2012 05:52
Spring Social ThymeleafConfig.java
package org.krams.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.thymeleaf.spring3.SpringTemplateEngine;
import org.thymeleaf.spring3.view.ThymeleafViewResolver;
import org.thymeleaf.templateresolver.ServletContextTemplateResolver;
@Configuration
public class ThymeleafConfig {
@krams915
krams915 / DataConfig.java
Created December 8, 2012 05:51
Spring Social DataConfig.java
package org.krams.config;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.orm.jpa.JpaTransactionManager;