└── springbootsample ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── mysample │ │ └── springbootsample │ │ ├── App.java │ │ ├── config │ │ ├── RepositoryConfig.java │ │ ├── SecurityConfig.java │ │ ├── ThymeleafConfig.java │ │ └── WebConfig.java │ │ ├── controller │ │ └── AdminController.java │ │ ├── dbloader │ │ └── UserDataLoader.java │ │ ├── domain │ │ ├── Address.java │ │ ├── User.java │ │ └── UserRole.java │ │ ├── repository │ │ ├── UserRepository.java │ │ └── UserRoleRepository.java │ │ └── security │ │ └── CustomUserDetailsService.java ├── resources │ ├── application.properties │ └── database.properties └── webapp │ ├── css │ ├── common.css │ └── sb-admin-2.css │ ├── images │ └── home.png │ ├── js │ └── sb-admin-2.js │ ├── resources │ ├── font-awesome │ │ ├── .bower.json │ │ ├── .npmignore │ │ ├── css │ │ │ └── font-awesome.min.css │ │ └── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ └── fontawesome-webfont.woff │ └── metisMenu │ │ ├── .bower.json │ │ └── dist │ │ ├── metisMenu.min.css │ │ └── metisMenu.min.js │ └── views │ ├── 401.html │ ├── 404.html │ ├── 505.html │ ├── dashboard.html │ ├── fragments │ ├── footer.html │ ├── header.html │ └── sidebar.html │ ├── layout │ ├── default.html │ └── public.html │ └── signin.html └── test └── java └── com └── mysample ├── AppTest.java └── UserRepositoryTest.java /springbootsample/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.mysample 6 | springbootsample 7 | 1.0.1 8 | war 9 | 10 | springbootsample 11 | http://maven.apache.org 12 | 13 | 14 | org.springframework.boot 15 | spring-boot-starter-parent 16 | 1.2.7.RELEASE 17 | 18 | 19 | 20 | 21 | UTF-8 22 | 1.7 23 | 24 | 25 | 26 | 27 | org.springframework.boot 28 | spring-boot-starter-thymeleaf 29 | 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-starter-web 34 | 35 | 36 | 37 | org.springframework.boot 38 | spring-boot-starter-data-jpa 39 | 40 | 41 | 42 | org.webjars 43 | bootstrap 44 | 3.3.4 45 | 46 | 47 | 48 | org.webjars 49 | jquery 50 | 1.11.3 51 | 52 | 53 | 54 | org.springframework.boot 55 | spring-boot-starter-security 56 | 57 | 58 | 59 | org.thymeleaf.extras 60 | thymeleaf-extras-springsecurity3 61 | 62 | 63 | 64 | org.springframework.boot 65 | spring-boot-starter-tomcat 66 | provided 67 | 68 | 69 | 70 | com.h2database 71 | h2 72 | 73 | 74 | 75 | org.springframework.boot 76 | spring-boot-starter-test 77 | 78 | 79 | 80 | 81 | 82 | 83 | org.springframework.boot 84 | spring-boot-maven-plugin 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /springbootsample/src/main/java/com/mysample/springbootsample/App.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package com.mysample.springbootsample; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | import org.springframework.boot.builder.SpringApplicationBuilder; 22 | import org.springframework.boot.context.web.SpringBootServletInitializer; 23 | 24 | /** 25 | * Spring Boot Servlet Initializer 26 | */ 27 | @SpringBootApplication 28 | public class App extends SpringBootServletInitializer{ 29 | 30 | @Override 31 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 32 | return application.sources(App.class); 33 | } 34 | 35 | public static void main( String[] args ) { 36 | SpringApplication.run(App.class, args); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /springbootsample/src/main/java/com/mysample/springbootsample/config/RepositoryConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package com.mysample.springbootsample.config; 18 | 19 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 20 | import org.springframework.boot.orm.jpa.EntityScan; 21 | import org.springframework.context.annotation.Configuration; 22 | import org.springframework.data.jpa.repository.config.EnableJpaRepositories; 23 | import org.springframework.transaction.annotation.EnableTransactionManagement; 24 | 25 | @Configuration 26 | @EnableAutoConfiguration 27 | @EntityScan(basePackages = {"com.mysample.springbootsample.domain"}) 28 | @EnableJpaRepositories(basePackages = {"com.mysample.springbootsample.repository"}) 29 | @EnableTransactionManagement 30 | public class RepositoryConfig { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /springbootsample/src/main/java/com/mysample/springbootsample/config/SecurityConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package com.mysample.springbootsample.config; 18 | 19 | import java.util.EnumSet; 20 | 21 | import javax.servlet.DispatcherType; 22 | import javax.servlet.Filter; 23 | 24 | import org.springframework.beans.factory.annotation.Autowired; 25 | import org.springframework.beans.factory.annotation.Qualifier; 26 | import org.springframework.boot.context.embedded.FilterRegistrationBean; 27 | import org.springframework.context.annotation.Bean; 28 | import org.springframework.context.annotation.Configuration; 29 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 30 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 31 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 32 | import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity; 33 | import org.springframework.security.core.userdetails.UserDetailsService; 34 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 35 | import org.springframework.security.crypto.password.PasswordEncoder; 36 | 37 | @Configuration 38 | @EnableWebMvcSecurity 39 | public class SecurityConfig extends WebSecurityConfigurerAdapter { 40 | 41 | @Autowired 42 | @Qualifier("customUserDetailsService") 43 | private UserDetailsService customUserDetailsService; 44 | 45 | @Override 46 | protected void configure(HttpSecurity httpSecurity) throws Exception { 47 | 48 | // Security configuration for H2 console access 49 | // !!!! You MUST NOT use this configuration for PRODUCTION site !!!! 50 | httpSecurity.authorizeRequests().antMatchers("/console/**").permitAll(); 51 | httpSecurity.csrf().disable(); 52 | httpSecurity.headers().frameOptions().disable(); 53 | 54 | // static resources 55 | httpSecurity.authorizeRequests() 56 | .antMatchers("/css/**", "/js/**", "/images/**", "/resources/**", "/webjars/**").permitAll(); 57 | 58 | httpSecurity.authorizeRequests() 59 | .antMatchers("/signin").anonymous() 60 | .anyRequest().authenticated() 61 | .and() 62 | .formLogin() 63 | .loginPage("/signin") 64 | .loginProcessingUrl("/sign-in-process.html") 65 | .failureUrl("/signin?error") 66 | .usernameParameter("username") 67 | .passwordParameter("password") 68 | .defaultSuccessUrl("/admin/dashboard.html", true) 69 | .and() 70 | .logout() 71 | .logoutSuccessUrl("/signin?logout"); 72 | 73 | httpSecurity.exceptionHandling().accessDeniedPage("/admin/dashboard.html"); 74 | httpSecurity.sessionManagement().invalidSessionUrl("/signin"); 75 | 76 | } 77 | 78 | @Override 79 | protected void configure(AuthenticationManagerBuilder auth) throws Exception { 80 | 81 | auth.userDetailsService(customUserDetailsService); 82 | 83 | // In case of password encryption - for production site 84 | //auth.userDetailsService(customerUserDetailsService).passwordEncoder(passwordEncoder()); 85 | } 86 | 87 | @Bean 88 | public FilterRegistrationBean getSpringSecurityFilterChainBindedToError( 89 | @Qualifier("springSecurityFilterChain") Filter springSecurityFilterChain) { 90 | 91 | FilterRegistrationBean registration = new FilterRegistrationBean(); 92 | registration.setFilter(springSecurityFilterChain); 93 | registration.setDispatcherTypes(EnumSet.allOf(DispatcherType.class)); 94 | return registration; 95 | } 96 | 97 | @Bean 98 | public PasswordEncoder passwordEncoder() { 99 | PasswordEncoder encoder = new BCryptPasswordEncoder(); 100 | return encoder; 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /springbootsample/src/main/java/com/mysample/springbootsample/config/ThymeleafConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package com.mysample.springbootsample.config; 18 | 19 | import nz.net.ultraq.thymeleaf.LayoutDialect; 20 | 21 | import org.springframework.context.annotation.Bean; 22 | import org.springframework.context.annotation.Configuration; 23 | import org.springframework.web.servlet.ViewResolver; 24 | import org.thymeleaf.extras.springsecurity3.dialect.SpringSecurityDialect; 25 | import org.thymeleaf.spring4.SpringTemplateEngine; 26 | import org.thymeleaf.spring4.view.ThymeleafViewResolver; 27 | import org.thymeleaf.templateresolver.ServletContextTemplateResolver; 28 | import org.thymeleaf.templateresolver.TemplateResolver; 29 | 30 | @Configuration 31 | public class ThymeleafConfig { 32 | 33 | @Bean 34 | public TemplateResolver templateResolver(){ 35 | ServletContextTemplateResolver templateResolver = new ServletContextTemplateResolver(); 36 | templateResolver.setPrefix("/views/"); 37 | templateResolver.setSuffix(".html"); 38 | templateResolver.setTemplateMode("HTML5"); 39 | templateResolver.setCacheable(false); 40 | return templateResolver; 41 | } 42 | 43 | @Bean 44 | public SpringTemplateEngine templateEngine(){ 45 | SpringTemplateEngine templateEngine = new SpringTemplateEngine(); 46 | templateEngine.setTemplateResolver(templateResolver()); 47 | templateEngine.addDialect(new LayoutDialect()); 48 | templateEngine.addDialect(new SpringSecurityDialect()); 49 | return templateEngine; 50 | } 51 | 52 | @Bean 53 | public ViewResolver viewResolver(){ 54 | ThymeleafViewResolver viewResolver = new ThymeleafViewResolver() ; 55 | viewResolver.setTemplateEngine(templateEngine()); 56 | viewResolver.setOrder(1); 57 | return viewResolver; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /springbootsample/src/main/java/com/mysample/springbootsample/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package com.mysample.springbootsample.config; 18 | 19 | import org.h2.server.web.WebServlet; 20 | import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; 21 | import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer; 22 | import org.springframework.boot.context.embedded.ErrorPage; 23 | import org.springframework.boot.context.embedded.ServletRegistrationBean; 24 | import org.springframework.context.annotation.Bean; 25 | import org.springframework.context.annotation.ComponentScan; 26 | import org.springframework.context.annotation.Configuration; 27 | import org.springframework.context.annotation.PropertySource; 28 | import org.springframework.http.HttpStatus; 29 | import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; 30 | import org.springframework.web.servlet.config.annotation.EnableWebMvc; 31 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 32 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 33 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 34 | 35 | @Configuration 36 | @EnableWebMvc 37 | @ComponentScan(basePackages = "com.mysample.springbootsample.*") 38 | @PropertySource({"classpath:application.properties", "classpath:database.properties"}) 39 | public class WebConfig extends WebMvcConfigurerAdapter { 40 | 41 | @Override 42 | public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { 43 | configurer.enable(); 44 | } 45 | 46 | @Override 47 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 48 | registry.addResourceHandler("/resources/**").addResourceLocations("/resources/"); 49 | registry.addResourceHandler("/css/**").addResourceLocations("/css/"); 50 | registry.addResourceHandler("/js/**").addResourceLocations("/js/"); 51 | registry.addResourceHandler("/images/**").addResourceLocations("/images/"); 52 | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); 53 | } 54 | 55 | @Override 56 | public void addViewControllers(ViewControllerRegistry registry) { 57 | registry.addViewController("/signin").setViewName("signin"); 58 | registry.addViewController("/error/404.html").setViewName("404"); 59 | registry.addViewController("/error/505.html").setViewName("505"); 60 | } 61 | 62 | @Bean 63 | public EmbeddedServletContainerCustomizer containerCustomizer() { 64 | return new EmbeddedServletContainerCustomizer() { 65 | @Override 66 | public void customize(ConfigurableEmbeddedServletContainer container) { 67 | ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/error/404.html"); 68 | ErrorPage error505Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error/505.html"); 69 | 70 | container.addErrorPages(error404Page, error505Page); 71 | } 72 | }; 73 | } 74 | 75 | @Bean 76 | ServletRegistrationBean h2servletRegistration(){ 77 | ServletRegistrationBean registrationBean = new ServletRegistrationBean(new WebServlet()); 78 | registrationBean.addUrlMappings("/console/*"); 79 | return registrationBean; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /springbootsample/src/main/java/com/mysample/springbootsample/controller/AdminController.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package com.mysample.springbootsample.controller; 18 | 19 | import org.springframework.stereotype.Controller; 20 | import org.springframework.web.bind.annotation.RequestMapping; 21 | 22 | @RequestMapping(value = "/admin/") 23 | @Controller 24 | public class AdminController { 25 | 26 | @RequestMapping(value = "dashboard.html") 27 | public String dashboard() { 28 | 29 | return "dashboard"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /springbootsample/src/main/java/com/mysample/springbootsample/dbloader/UserDataLoader.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package com.mysample.springbootsample.dbloader; 18 | 19 | import java.util.HashSet; 20 | import java.util.Set; 21 | 22 | import org.apache.log4j.Logger; 23 | import org.springframework.beans.factory.annotation.Autowired; 24 | import org.springframework.context.ApplicationListener; 25 | import org.springframework.context.event.ContextRefreshedEvent; 26 | import org.springframework.stereotype.Component; 27 | 28 | import com.mysample.springbootsample.domain.Address; 29 | import com.mysample.springbootsample.domain.User; 30 | import com.mysample.springbootsample.domain.UserRole; 31 | import com.mysample.springbootsample.repository.UserRepository; 32 | import com.mysample.springbootsample.repository.UserRoleRepository; 33 | 34 | @Component 35 | public class UserDataLoader implements ApplicationListener { 36 | 37 | private Logger logger = Logger.getLogger(UserDataLoader.class); 38 | 39 | @Autowired 40 | private UserRepository userRepository; 41 | 42 | @Autowired 43 | private UserRoleRepository userRoleRepository; 44 | 45 | @Override 46 | public void onApplicationEvent(ContextRefreshedEvent event) { 47 | 48 | User admin = new User(); 49 | admin.setUsername("admin"); 50 | admin.setPassword("123456"); 51 | admin.setFirstName("Foo"); 52 | admin.setLastName("Bar"); 53 | 54 | Set addressSet = new HashSet(0); 55 | Address adminAddr1 = new Address(); 56 | adminAddr1.setAddress1("Street Address 1-1"); 57 | adminAddr1.setAddress2("Street Address 1-2"); 58 | adminAddr1.setAddrCity("Los Angeles"); 59 | adminAddr1.setAddrState("CA"); 60 | adminAddr1.setZipCode("90001"); 61 | adminAddr1.setUser(admin); 62 | addressSet.add(adminAddr1); 63 | 64 | Address adminAddr2 = new Address(); 65 | adminAddr2.setAddress1("Street Address 2-1"); 66 | adminAddr2.setAddress2("Street Address 2-1"); 67 | adminAddr2.setAddrCity("Los Angeles"); 68 | adminAddr2.setAddrState("CA"); 69 | adminAddr2.setZipCode("90002"); 70 | adminAddr2.setUser(admin); 71 | addressSet.add(adminAddr2); 72 | 73 | UserRole adminRole = new UserRole(); 74 | adminRole.setUserRoleName("Administrator"); 75 | adminRole.setUser(admin); 76 | Set adminRoles = new HashSet(0); 77 | adminRoles.add(adminRole); 78 | 79 | admin.setAddressSet(addressSet); 80 | admin.setUserRoles(adminRoles); 81 | 82 | userRepository.save(admin); 83 | logger.debug("Saved admin ID: " + admin.getUserId()); 84 | 85 | 86 | User user1 = new User(); 87 | user1.setUsername("johndoe"); 88 | user1.setPassword("123456"); 89 | user1.setFirstName("John"); 90 | user1.setLastName("Doe"); 91 | 92 | UserRole userRole = new UserRole(); 93 | userRole.setUserRoleName("User"); 94 | userRole.setUser(user1); 95 | Set userRoles = new HashSet(0); 96 | userRoles.add(userRole); 97 | 98 | user1.setUserRoles(userRoles); 99 | 100 | userRepository.save(user1); 101 | logger.debug("Saved user1 ID: " + user1.getUserId()); 102 | 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /springbootsample/src/main/java/com/mysample/springbootsample/domain/Address.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package com.mysample.springbootsample.domain; 18 | 19 | import javax.persistence.Column; 20 | import javax.persistence.Entity; 21 | import javax.persistence.GeneratedValue; 22 | import javax.persistence.GenerationType; 23 | import javax.persistence.Id; 24 | import javax.persistence.JoinColumn; 25 | import javax.persistence.ManyToOne; 26 | import javax.persistence.Table; 27 | 28 | @Entity 29 | @Table(name = "tbl_address") 30 | public class Address { 31 | 32 | @Id 33 | @GeneratedValue(strategy = GenerationType.AUTO) 34 | @Column(name = "id") 35 | private Long addrId; 36 | 37 | @Column(name = "address1", length = 256) 38 | private String address1; 39 | 40 | @Column(name = "address2", length = 256) 41 | private String address2; 42 | 43 | @Column(name = "city", length = 256) 44 | private String addrCity; 45 | 46 | @Column(name = "state", length = 64) 47 | private String addrState; 48 | 49 | @Column(name = "zip_code", length = 32) 50 | private String zipCode; 51 | 52 | @ManyToOne 53 | @JoinColumn(name = "user_id") 54 | private User user; 55 | 56 | /** 57 | * @return the addrId 58 | */ 59 | public Long getAddrId() { 60 | return addrId; 61 | } 62 | 63 | /** 64 | * @param addrId the addrId to set 65 | */ 66 | public void setAddrId(Long addrId) { 67 | this.addrId = addrId; 68 | } 69 | 70 | /** 71 | * @return the address1 72 | */ 73 | public String getAddress1() { 74 | return address1; 75 | } 76 | 77 | /** 78 | * @param address1 the address1 to set 79 | */ 80 | public void setAddress1(String address1) { 81 | this.address1 = address1; 82 | } 83 | 84 | /** 85 | * @return the address2 86 | */ 87 | public String getAddress2() { 88 | return address2; 89 | } 90 | 91 | /** 92 | * @param address2 the address2 to set 93 | */ 94 | public void setAddress2(String address2) { 95 | this.address2 = address2; 96 | } 97 | 98 | /** 99 | * @return the addrCity 100 | */ 101 | public String getAddrCity() { 102 | return addrCity; 103 | } 104 | 105 | /** 106 | * @param addrCity the addrCity to set 107 | */ 108 | public void setAddrCity(String addrCity) { 109 | this.addrCity = addrCity; 110 | } 111 | 112 | /** 113 | * @return the addrState 114 | */ 115 | public String getAddrState() { 116 | return addrState; 117 | } 118 | 119 | /** 120 | * @param addrState the addrState to set 121 | */ 122 | public void setAddrState(String addrState) { 123 | this.addrState = addrState; 124 | } 125 | 126 | /** 127 | * @return the zipCode 128 | */ 129 | public String getZipCode() { 130 | return zipCode; 131 | } 132 | 133 | /** 134 | * @param zipCode the zipCode to set 135 | */ 136 | public void setZipCode(String zipCode) { 137 | this.zipCode = zipCode; 138 | } 139 | 140 | /** 141 | * @return the user 142 | */ 143 | public User getUser() { 144 | return user; 145 | } 146 | 147 | /** 148 | * @param user the user to set 149 | */ 150 | public void setUser(User user) { 151 | this.user = user; 152 | } 153 | 154 | /* (non-Javadoc) 155 | * @see java.lang.Object#toString() 156 | */ 157 | @Override 158 | public String toString() { 159 | return "Address [addrId=" + addrId + ", address1=" + address1 160 | + ", address2=" + address2 + ", addrCity=" + addrCity 161 | + ", addrState=" + addrState + ", zipCode=" + zipCode + "]"; 162 | } 163 | 164 | } 165 | -------------------------------------------------------------------------------- /springbootsample/src/main/java/com/mysample/springbootsample/domain/User.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package com.mysample.springbootsample.domain; 18 | 19 | import java.util.HashSet; 20 | import java.util.Set; 21 | 22 | import javax.persistence.CascadeType; 23 | import javax.persistence.Column; 24 | import javax.persistence.Entity; 25 | import javax.persistence.FetchType; 26 | import javax.persistence.GeneratedValue; 27 | import javax.persistence.GenerationType; 28 | import javax.persistence.Id; 29 | import javax.persistence.OneToMany; 30 | import javax.persistence.Table; 31 | 32 | @Entity 33 | @Table(name="tbl_user") 34 | public class User { 35 | 36 | @Id 37 | @GeneratedValue(strategy = GenerationType.AUTO) 38 | @Column(name = "id") 39 | private Long userId; 40 | 41 | @Column(name = "username", unique = true, length = 64) 42 | private String username; 43 | 44 | @Column(name = "password", length = 256) 45 | private String password; 46 | 47 | @Column(name = "first_name", length = 128) 48 | private String firstName; 49 | 50 | @Column(name = "last_name", length = 128) 51 | private String lastName; 52 | 53 | @OneToMany(mappedBy = "user", cascade = {CascadeType.ALL}, fetch = FetchType.LAZY) 54 | private Set addressSet = new HashSet(0); 55 | 56 | @OneToMany(mappedBy = "user", cascade = {CascadeType.ALL}, fetch = FetchType.LAZY) 57 | private Set userRoles; 58 | 59 | /** 60 | * @return the userId 61 | */ 62 | public Long getUserId() { 63 | return userId; 64 | } 65 | 66 | /** 67 | * @param userId the userId to set 68 | */ 69 | public void setUserId(Long userId) { 70 | this.userId = userId; 71 | } 72 | 73 | /** 74 | * @return the username 75 | */ 76 | public String getUsername() { 77 | return username; 78 | } 79 | 80 | /** 81 | * @param username the username to set 82 | */ 83 | public void setUsername(String username) { 84 | this.username = username; 85 | } 86 | 87 | /** 88 | * @return the password 89 | */ 90 | public String getPassword() { 91 | return password; 92 | } 93 | 94 | /** 95 | * @param password the password to set 96 | */ 97 | public void setPassword(String password) { 98 | this.password = password; 99 | } 100 | 101 | /** 102 | * @return the firstName 103 | */ 104 | public String getFirstName() { 105 | return firstName; 106 | } 107 | 108 | /** 109 | * @param firstName the firstName to set 110 | */ 111 | public void setFirstName(String firstName) { 112 | this.firstName = firstName; 113 | } 114 | 115 | /** 116 | * @return the lastName 117 | */ 118 | public String getLastName() { 119 | return lastName; 120 | } 121 | 122 | /** 123 | * @param lastName the lastName to set 124 | */ 125 | public void setLastName(String lastName) { 126 | this.lastName = lastName; 127 | } 128 | 129 | /** 130 | * @return the addressSet 131 | */ 132 | public Set getAddressSet() { 133 | return addressSet; 134 | } 135 | 136 | /** 137 | * @param addressSet the addressSet to set 138 | */ 139 | public void setAddressSet(Set addressSet) { 140 | this.addressSet = addressSet; 141 | } 142 | 143 | /** 144 | * @return the userRoles 145 | */ 146 | public Set getUserRoles() { 147 | return userRoles; 148 | } 149 | 150 | /** 151 | * @param userRoles the userRoles to set 152 | */ 153 | public void setUserRoles(Set userRoles) { 154 | this.userRoles = userRoles; 155 | } 156 | 157 | /* (non-Javadoc) 158 | * @see java.lang.Object#toString() 159 | */ 160 | @Override 161 | public String toString() { 162 | return "User [userId=" + userId + ", username=" + username 163 | + ", password=" + password + ", firstName=" + firstName 164 | + ", lastName=" + lastName + ", addressSet=" + addressSet 165 | + ", userRoles=" + userRoles + "]"; 166 | } 167 | 168 | } 169 | -------------------------------------------------------------------------------- /springbootsample/src/main/java/com/mysample/springbootsample/domain/UserRole.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package com.mysample.springbootsample.domain; 18 | 19 | import javax.persistence.Column; 20 | import javax.persistence.Entity; 21 | import javax.persistence.GeneratedValue; 22 | import javax.persistence.GenerationType; 23 | import javax.persistence.Id; 24 | import javax.persistence.JoinColumn; 25 | import javax.persistence.ManyToOne; 26 | import javax.persistence.Table; 27 | 28 | @Entity 29 | @Table(name = "tbl_user_role") 30 | public class UserRole { 31 | 32 | @Id 33 | @GeneratedValue(strategy = GenerationType.AUTO) 34 | @Column(name = "id") 35 | private Integer userRoleId; 36 | 37 | @Column(name = "role_name", nullable = false, unique = true, length = 128) 38 | private String userRoleName; 39 | 40 | @ManyToOne 41 | @JoinColumn(name = "user_id") 42 | private User user; 43 | 44 | /** 45 | * @return the userRoleId 46 | */ 47 | public Integer getUserRoleId() { 48 | return userRoleId; 49 | } 50 | 51 | /** 52 | * @param userRoleId the userRoleId to set 53 | */ 54 | public void setUserRoleId(Integer userRoleId) { 55 | this.userRoleId = userRoleId; 56 | } 57 | 58 | /** 59 | * @return the userRoleName 60 | */ 61 | public String getUserRoleName() { 62 | return userRoleName; 63 | } 64 | 65 | /** 66 | * @param userRoleName the userRoleName to set 67 | */ 68 | public void setUserRoleName(String userRoleName) { 69 | this.userRoleName = userRoleName; 70 | } 71 | 72 | /** 73 | * @return the user 74 | */ 75 | public User getUser() { 76 | return user; 77 | } 78 | 79 | /** 80 | * @param user the user to set 81 | */ 82 | public void setUser(User user) { 83 | this.user = user; 84 | } 85 | 86 | /* (non-Javadoc) 87 | * @see java.lang.Object#toString() 88 | */ 89 | @Override 90 | public String toString() { 91 | return "UserRole [userRoleId=" + userRoleId + ", userRoleName=" 92 | + userRoleName + "]"; 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /springbootsample/src/main/java/com/mysample/springbootsample/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package com.mysample.springbootsample.repository; 18 | 19 | import org.springframework.beans.factory.annotation.Qualifier; 20 | import org.springframework.data.repository.CrudRepository; 21 | import org.springframework.stereotype.Repository; 22 | 23 | import com.mysample.springbootsample.domain.User; 24 | 25 | @Repository 26 | @Qualifier(value = "userRepository") 27 | public interface UserRepository extends CrudRepository { 28 | 29 | public User findByUsername(String username); 30 | } 31 | -------------------------------------------------------------------------------- /springbootsample/src/main/java/com/mysample/springbootsample/repository/UserRoleRepository.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package com.mysample.springbootsample.repository; 18 | 19 | import org.springframework.beans.factory.annotation.Qualifier; 20 | import org.springframework.data.repository.CrudRepository; 21 | import org.springframework.stereotype.Repository; 22 | 23 | import com.mysample.springbootsample.domain.UserRole; 24 | 25 | @Repository 26 | @Qualifier(value = "userRoleRepository") 27 | public interface UserRoleRepository extends CrudRepository { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /springbootsample/src/main/java/com/mysample/springbootsample/security/CustomUserDetailsService.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package com.mysample.springbootsample.security; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | import java.util.Set; 22 | 23 | import org.springframework.beans.factory.annotation.Autowired; 24 | import org.springframework.security.core.GrantedAuthority; 25 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 26 | import org.springframework.security.core.userdetails.User; 27 | import org.springframework.security.core.userdetails.UserDetails; 28 | import org.springframework.security.core.userdetails.UserDetailsService; 29 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 30 | import org.springframework.stereotype.Service; 31 | import org.springframework.transaction.annotation.Transactional; 32 | 33 | import com.mysample.springbootsample.domain.UserRole; 34 | import com.mysample.springbootsample.repository.UserRepository; 35 | 36 | @Service("customUserDetailsService") 37 | public class CustomUserDetailsService implements UserDetailsService { 38 | 39 | @Autowired 40 | private UserRepository userRepository; 41 | 42 | @Transactional 43 | @Override 44 | public UserDetails loadUserByUsername(String username) 45 | throws UsernameNotFoundException { 46 | 47 | com.mysample.springbootsample.domain.User user = userRepository.findByUsername(username); 48 | List authorities = buildUserAuthority(user.getUserRoles()); 49 | 50 | return buildUserForAuthentication(user, authorities); 51 | } 52 | 53 | private User buildUserForAuthentication(com.mysample.springbootsample.domain.User user, 54 | List authorities) { 55 | 56 | return new User(user.getUsername(), user.getPassword(), 57 | true, true, true, true, authorities); 58 | } 59 | 60 | private List buildUserAuthority(Set userRoles) { 61 | 62 | List authorities = new ArrayList(0); 63 | for (UserRole userRole : userRoles) { 64 | authorities.add(new SimpleGrantedAuthority(userRole.getUserRoleName())); 65 | } 66 | 67 | return authorities; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /springbootsample/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright 2015 Brient Oh @ Pristine Core 3 | # boh@pristinecore.com 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | ############################################################################### 17 | ## 18 | # application.properties 19 | ## 20 | 21 | ## THYMELEAF (ThymeleafAutoConfiguration) 22 | spring.thymeleaf.check-template-location=false 23 | -------------------------------------------------------------------------------- /springbootsample/src/main/resources/database.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright 2015 Brient Oh @ Pristine Core 3 | # boh@pristinecore.com 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | ############################################################################### 17 | ## 18 | # database.properties 19 | ## 20 | 21 | ## DataSource configuration 22 | spring.datasource.url=jdbc:h2:mem:test;DB_CLOSE_ON_EXIT=FALSE 23 | spring.datasource.username=sa 24 | spring.datasource.password= 25 | spring.datasource.driver-class-name=org.h2.Driver 26 | 27 | ## Hibernate configuration 28 | spring.jpa.database=H2 29 | spring.jpa.hibernate.ddl-auto=create-drop 30 | spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy 31 | spring.jpa.show-sql=true 32 | -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/css/common.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #fff; 3 | } 4 | 5 | p { 6 | font-weight: bold; 7 | } 8 | 9 | header p { 10 | color: red; 11 | font-weight: bold; 12 | } 13 | 14 | footer p { 15 | color: blue; 16 | font-weight: bold; 17 | } -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/css/sb-admin-2.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Start Bootstrap - SB Admin 2 Bootstrap Admin Theme (http://startbootstrap.com) 3 | * Code licensed under the Apache License v2.0. 4 | * For details, see http://www.apache.org/licenses/LICENSE-2.0. 5 | */ 6 | 7 | body { 8 | background-color: #f8f8f8;; 9 | } 10 | 11 | #wrapper { 12 | width: 100%; 13 | } 14 | 15 | #page-wrapper { 16 | padding: 0 15px; 17 | min-height: 568px; 18 | background-color: #fff; 19 | } 20 | 21 | @media(min-width:768px) { 22 | #page-wrapper { 23 | position: inherit; 24 | margin: 0 0 0 250px; 25 | padding: 0 30px; 26 | border-left: 1px solid #e7e7e7; 27 | } 28 | } 29 | 30 | .navbar-top-links { 31 | margin-right: 0; 32 | } 33 | 34 | .navbar-top-links li { 35 | display: inline-block; 36 | } 37 | 38 | .navbar-top-links li:last-child { 39 | margin-right: 15px; 40 | } 41 | 42 | .navbar-top-links li a { 43 | padding: 15px; 44 | min-height: 50px; 45 | } 46 | 47 | .navbar-top-links .dropdown-menu li { 48 | display: block; 49 | } 50 | 51 | .navbar-top-links .dropdown-menu li:last-child { 52 | margin-right: 0; 53 | } 54 | 55 | .navbar-top-links .dropdown-menu li a { 56 | padding: 3px 20px; 57 | min-height: 0; 58 | } 59 | 60 | .navbar-top-links .dropdown-menu li a div { 61 | white-space: normal; 62 | } 63 | 64 | .navbar-top-links .dropdown-messages, 65 | .navbar-top-links .dropdown-tasks, 66 | .navbar-top-links .dropdown-alerts { 67 | width: 310px; 68 | min-width: 0; 69 | } 70 | 71 | .navbar-top-links .dropdown-messages { 72 | margin-left: 5px; 73 | } 74 | 75 | .navbar-top-links .dropdown-tasks { 76 | margin-left: -59px; 77 | } 78 | 79 | .navbar-top-links .dropdown-alerts { 80 | margin-left: -123px; 81 | } 82 | 83 | .navbar-top-links .dropdown-user { 84 | right: 0; 85 | left: auto; 86 | } 87 | 88 | .sidebar .sidebar-nav.navbar-collapse { 89 | padding-right: 0; 90 | padding-left: 0; 91 | } 92 | 93 | .sidebar .sidebar-search { 94 | padding: 15px; 95 | } 96 | 97 | .sidebar ul li { 98 | border-bottom: 1px solid #e7e7e7; 99 | } 100 | 101 | .sidebar ul li a.active { 102 | background-color: #eee; 103 | } 104 | 105 | .sidebar .arrow { 106 | float: right; 107 | } 108 | 109 | .sidebar .fa.arrow:before { 110 | content: "\f104"; 111 | } 112 | 113 | .sidebar .active>a>.fa.arrow:before { 114 | content: "\f107"; 115 | } 116 | 117 | .sidebar .nav-second-level li, 118 | .sidebar .nav-third-level li { 119 | border-bottom: 0!important; 120 | } 121 | 122 | .sidebar .nav-second-level li a { 123 | padding-left: 37px; 124 | } 125 | 126 | .sidebar .nav-third-level li a { 127 | padding-left: 52px; 128 | } 129 | 130 | @media(min-width:768px) { 131 | .sidebar { 132 | z-index: 1; 133 | position: absolute; 134 | width: 250px; 135 | margin-top: 51px; 136 | } 137 | 138 | .navbar-top-links .dropdown-messages, 139 | .navbar-top-links .dropdown-tasks, 140 | .navbar-top-links .dropdown-alerts { 141 | margin-left: auto; 142 | } 143 | } 144 | 145 | .btn-outline { 146 | color: inherit; 147 | background-color: transparent; 148 | transition: all .5s; 149 | } 150 | 151 | .btn-primary.btn-outline { 152 | color: #428bca; 153 | } 154 | 155 | .btn-success.btn-outline { 156 | color: #5cb85c; 157 | } 158 | 159 | .btn-info.btn-outline { 160 | color: #5bc0de; 161 | } 162 | 163 | .btn-warning.btn-outline { 164 | color: #f0ad4e; 165 | } 166 | 167 | .btn-danger.btn-outline { 168 | color: #d9534f; 169 | } 170 | 171 | .btn-primary.btn-outline:hover, 172 | .btn-success.btn-outline:hover, 173 | .btn-info.btn-outline:hover, 174 | .btn-warning.btn-outline:hover, 175 | .btn-danger.btn-outline:hover { 176 | color: #fff; 177 | } 178 | 179 | .chat { 180 | margin: 0; 181 | padding: 0; 182 | list-style: none; 183 | } 184 | 185 | .chat li { 186 | margin-bottom: 10px; 187 | padding-bottom: 5px; 188 | border-bottom: 1px dotted #999; 189 | } 190 | 191 | .chat li.left .chat-body { 192 | margin-left: 60px; 193 | } 194 | 195 | .chat li.right .chat-body { 196 | margin-right: 60px; 197 | } 198 | 199 | .chat li .chat-body p { 200 | margin: 0; 201 | } 202 | 203 | .panel .slidedown .glyphicon, 204 | .chat .glyphicon { 205 | margin-right: 5px; 206 | } 207 | 208 | .chat-panel .panel-body { 209 | height: 350px; 210 | overflow-y: scroll; 211 | } 212 | 213 | .login-panel { 214 | margin-top: 25%; 215 | } 216 | 217 | .flot-chart { 218 | display: block; 219 | height: 400px; 220 | } 221 | 222 | .flot-chart-content { 223 | width: 100%; 224 | height: 100%; 225 | } 226 | 227 | .dataTables_wrapper { 228 | position: relative; 229 | clear: both; 230 | } 231 | 232 | table.dataTable thead .sorting, 233 | table.dataTable thead .sorting_asc, 234 | table.dataTable thead .sorting_desc, 235 | table.dataTable thead .sorting_asc_disabled, 236 | table.dataTable thead .sorting_desc_disabled { 237 | background: 0 0; 238 | } 239 | 240 | table.dataTable thead .sorting_asc:after { 241 | content: "\f0de"; 242 | float: right; 243 | font-family: fontawesome; 244 | } 245 | 246 | table.dataTable thead .sorting_desc:after { 247 | content: "\f0dd"; 248 | float: right; 249 | font-family: fontawesome; 250 | } 251 | 252 | table.dataTable thead .sorting:after { 253 | content: "\f0dc"; 254 | float: right; 255 | font-family: fontawesome; 256 | color: rgba(50,50,50,.5); 257 | } 258 | 259 | .btn-circle { 260 | width: 30px; 261 | height: 30px; 262 | padding: 6px 0; 263 | border-radius: 15px; 264 | text-align: center; 265 | font-size: 12px; 266 | line-height: 1.428571429; 267 | } 268 | 269 | .btn-circle.btn-lg { 270 | width: 50px; 271 | height: 50px; 272 | padding: 10px 16px; 273 | border-radius: 25px; 274 | font-size: 18px; 275 | line-height: 1.33; 276 | } 277 | 278 | .btn-circle.btn-xl { 279 | width: 70px; 280 | height: 70px; 281 | padding: 10px 16px; 282 | border-radius: 35px; 283 | font-size: 24px; 284 | line-height: 1.33; 285 | } 286 | 287 | .show-grid [class^=col-] { 288 | padding-top: 10px; 289 | padding-bottom: 10px; 290 | border: 1px solid #ddd; 291 | background-color: #eee!important; 292 | } 293 | 294 | .show-grid { 295 | margin: 15px 0; 296 | } 297 | 298 | .huge { 299 | font-size: 40px; 300 | } 301 | 302 | .panel-green { 303 | border-color: #5cb85c; 304 | } 305 | 306 | .panel-green .panel-heading { 307 | border-color: #5cb85c; 308 | color: #fff; 309 | background-color: #5cb85c; 310 | } 311 | 312 | .panel-green a { 313 | color: #5cb85c; 314 | } 315 | 316 | .panel-green a:hover { 317 | color: #3d8b3d; 318 | } 319 | 320 | .panel-red { 321 | border-color: #d9534f; 322 | } 323 | 324 | .panel-red .panel-heading { 325 | border-color: #d9534f; 326 | color: #fff; 327 | background-color: #d9534f; 328 | } 329 | 330 | .panel-red a { 331 | color: #d9534f; 332 | } 333 | 334 | .panel-red a:hover { 335 | color: #b52b27; 336 | } 337 | 338 | .panel-yellow { 339 | border-color: #f0ad4e; 340 | } 341 | 342 | .panel-yellow .panel-heading { 343 | border-color: #f0ad4e; 344 | color: #fff; 345 | background-color: #f0ad4e; 346 | } 347 | 348 | .panel-yellow a { 349 | color: #f0ad4e; 350 | } 351 | 352 | .panel-yellow a:hover { 353 | color: #df8a13; 354 | } -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/images/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pristinecore/springbootsample/80aafbd173281955f7276d0277f48d8fea575ca6/springbootsample/src/main/webapp/images/home.png -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/js/sb-admin-2.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | $(function() { 18 | 19 | $('#side-menu').metisMenu(); 20 | 21 | }); 22 | 23 | //Loads the correct sidebar on window load, 24 | //collapses the sidebar on window resize. 25 | // Sets the min-height of #page-wrapper to window size 26 | $(function() { 27 | $(window).bind("load resize", function() { 28 | topOffset = 50; 29 | width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width; 30 | if (width < 768) { 31 | $('div.navbar-collapse').addClass('collapse'); 32 | topOffset = 100; // 2-row-menu 33 | } else { 34 | $('div.navbar-collapse').removeClass('collapse'); 35 | } 36 | 37 | height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1; 38 | height = height - topOffset; 39 | if (height < 1) height = 1; 40 | if (height > topOffset) { 41 | $("#page-wrapper").css("min-height", (height) + "px"); 42 | } 43 | }); 44 | 45 | var url = window.location; 46 | var element = $('ul.nav a').filter(function() { 47 | return this.href == url || url.href.indexOf(this.href) == 0; 48 | }).addClass('active').parent().parent().addClass('in').parent(); 49 | if (element.is('li')) { 50 | element.addClass('active'); 51 | } 52 | }); 53 | -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/resources/font-awesome/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "font-awesome", 3 | "description": "Font Awesome", 4 | "version": "4.2.0", 5 | "keywords": [], 6 | "homepage": "http://fontawesome.io", 7 | "dependencies": {}, 8 | "devDependencies": {}, 9 | "license": [ 10 | "OFL-1.1", 11 | "MIT", 12 | "CC-BY-3.0" 13 | ], 14 | "main": [ 15 | "./css/font-awesome.css", 16 | "./fonts/*" 17 | ], 18 | "ignore": [ 19 | "*/.*", 20 | "*.json", 21 | "src", 22 | "*.yml", 23 | "Gemfile", 24 | "Gemfile.lock", 25 | "*.md" 26 | ], 27 | "_release": "4.2.0", 28 | "_resolution": { 29 | "type": "version", 30 | "tag": "v4.2.0", 31 | "commit": "0b924144a95a54fa738d0450ff66c1dabd11ae74" 32 | }, 33 | "_source": "git://github.com/FortAwesome/Font-Awesome.git", 34 | "_target": "~4.2.0", 35 | "_originalSource": "font-awesome" 36 | } -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/resources/font-awesome/.npmignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.egg-info 3 | *.db 4 | *.db.old 5 | *.swp 6 | *.db-journal 7 | 8 | .coverage 9 | .DS_Store 10 | .installed.cfg 11 | _gh_pages/* 12 | 13 | .idea/* 14 | .svn/* 15 | src/website/static/* 16 | src/website/media/* 17 | 18 | bin 19 | cfcache 20 | develop-eggs 21 | dist 22 | downloads 23 | eggs 24 | parts 25 | tmp 26 | .sass-cache 27 | node_modules 28 | 29 | src/website/settingslocal.py 30 | stunnel.log 31 | 32 | .ruby-version 33 | 34 | # don't need these in the npm package. 35 | src/ 36 | _config.yml 37 | bower.json 38 | component.json 39 | composer.json 40 | CONTRIBUTING.md 41 | Gemfile 42 | Gemfile.lock 43 | -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/resources/font-awesome/css/font-awesome.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.2.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"} -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/resources/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pristinecore/springbootsample/80aafbd173281955f7276d0277f48d8fea575ca6/springbootsample/src/main/webapp/resources/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/resources/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pristinecore/springbootsample/80aafbd173281955f7276d0277f48d8fea575ca6/springbootsample/src/main/webapp/resources/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/resources/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pristinecore/springbootsample/80aafbd173281955f7276d0277f48d8fea575ca6/springbootsample/src/main/webapp/resources/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/resources/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pristinecore/springbootsample/80aafbd173281955f7276d0277f48d8fea575ca6/springbootsample/src/main/webapp/resources/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/resources/metisMenu/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "metisMenu", 3 | "version": "1.1.3", 4 | "homepage": "https://github.com/onokumus/metisMenu", 5 | "authors": [ 6 | "onokumus " 7 | ], 8 | "description": "Easy menu jQuery plugin for Twitter Bootstrap 3", 9 | "main": [ 10 | "dist/metisMenu.js", 11 | "dist/metisMenu.css" 12 | ], 13 | "keywords": [ 14 | "twitter", 15 | "bootstrap", 16 | "twbs", 17 | "jquery", 18 | "menu", 19 | "accordion", 20 | "toggle", 21 | "metis", 22 | "metisMenu" 23 | ], 24 | "license": "MIT", 25 | "ignore": [ 26 | "**/.*", 27 | "node_modules", 28 | "bower_components", 29 | "test", 30 | "tests" 31 | ], 32 | "dependencies": { 33 | "bootstrap": "~3.3.0" 34 | }, 35 | "_release": "1.1.3", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "1.1.3", 39 | "commit": "8e179d59f60a593203667c092119779dc36f5171" 40 | }, 41 | "_source": "git://github.com/onokumus/metisMenu.git", 42 | "_target": "~1.1.3", 43 | "_originalSource": "metisMenu", 44 | "_direct": true 45 | } -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/resources/metisMenu/dist/metisMenu.min.css: -------------------------------------------------------------------------------- 1 | /* 2 | * metismenu - v1.1.3 3 | * Easy menu jQuery plugin for Twitter Bootstrap 3 4 | * https://github.com/onokumus/metisMenu 5 | * 6 | * Made by Osman Nuri Okumus 7 | * Under MIT License 8 | */ 9 | 10 | .arrow{float:right;line-height:1.42857}.glyphicon.arrow:before{content:"\e079"}.active>a>.glyphicon.arrow:before{content:"\e114"}.fa.arrow:before{content:"\f104"}.active>a>.fa.arrow:before{content:"\f107"}.plus-times{float:right}.fa.plus-times:before{content:"\f067"}.active>a>.fa.plus-times{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.plus-minus{float:right}.fa.plus-minus:before{content:"\f067"}.active>a>.fa.plus-minus:before{content:"\f068"} -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/resources/metisMenu/dist/metisMenu.min.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | /* 18 | * metismenu - v1.1.3 19 | * Easy menu jQuery plugin for Twitter Bootstrap 3 20 | * https://github.com/onokumus/metisMenu 21 | * 22 | * Made by Osman Nuri Okumus 23 | * Under MIT License 24 | */ 25 | !function(a,b,c){function d(b,c){this.element=a(b),this.settings=a.extend({},f,c),this._defaults=f,this._name=e,this.init()}var e="metisMenu",f={toggle:!0,doubleTapToGo:!1};d.prototype={init:function(){var b=this.element,d=this.settings.toggle,f=this;this.isIE()<=9?(b.find("li.active").has("ul").children("ul").collapse("show"),b.find("li").not(".active").has("ul").children("ul").collapse("hide")):(b.find("li.active").has("ul").children("ul").addClass("collapse in"),b.find("li").not(".active").has("ul").children("ul").addClass("collapse")),f.settings.doubleTapToGo&&b.find("li.active").has("ul").children("a").addClass("doubleTapToGo"),b.find("li").has("ul").children("a").on("click."+e,function(b){return b.preventDefault(),f.settings.doubleTapToGo&&f.doubleTapToGo(a(this))&&"#"!==a(this).attr("href")&&""!==a(this).attr("href")?(b.stopPropagation(),void(c.location=a(this).attr("href"))):(a(this).parent("li").toggleClass("active").children("ul").collapse("toggle"),void(d&&a(this).parent("li").siblings().removeClass("active").children("ul.in").collapse("hide")))})},isIE:function(){for(var a,b=3,d=c.createElement("div"),e=d.getElementsByTagName("i");d.innerHTML="",e[0];)return b>4?b:a},doubleTapToGo:function(a){var b=this.element;return a.hasClass("doubleTapToGo")?(a.removeClass("doubleTapToGo"),!0):a.parent().children("ul").length?(b.find(".doubleTapToGo").removeClass("doubleTapToGo"),a.addClass("doubleTapToGo"),!1):void 0},remove:function(){this.element.off("."+e),this.element.removeData(e)}},a.fn[e]=function(b){return this.each(function(){var c=a(this);c.data(e)&&c.data(e).remove(),c.data(e,new d(this,b))}),this}}(jQuery,window,document); -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/views/401.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Spring Boot and Thymeleaf - 401 Error 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 401 Error 22 | You don't have a permission to access this page. 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/views/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Spring Boot and Thymeleaf - 404 Error 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 404 Error 22 | Page not found. 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/views/505.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Spring Boot and Thymeleaf - 505 Error 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 505 Error 22 | There is internal server error. 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/views/dashboard.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Spring Boot and Thymeleaf Integration Sample 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Dashboard 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/views/fragments/footer.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/views/fragments/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Toggle navigation 5 | 6 | 7 | 8 | 9 | Spring Boot and Thymeleaf 10 | 11 | 12 | 13 | 14 | Dashboard 15 | 16 | Username 17 | 18 | User Profile 19 | 20 | Logout 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/views/fragments/sidebar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Dashboard 6 | 7 | 8 | Charts 9 | 10 | Flot Charts 11 | Morris.js Charts 12 | 13 | 14 | 15 | Tables 16 | Forms 17 | 18 | UI Elements 19 | 20 | Panels and Wells 21 | Buttons 22 | Notifications 23 | Typography 24 | Icons 25 | Grid 26 | 27 | 28 | 29 | 30 | Multi-Level Dropdown 31 | 32 | Second Level Item 33 | Second Level Item 34 | 35 | Third Level 36 | 37 | Third Level Item 38 | Third Level Item 39 | Third Level Item 40 | Third Level Item 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | Sample Pages 49 | 50 | Sample1 Page 51 | Sample2 Page 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/views/layout/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Spring Boot and Thymeleaf - Thymeleaf Layout Dialect 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Toggle navigation 25 | 26 | 27 | 28 | 29 | SB Admin v2.0 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Side Bar Menu 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | Blank 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/views/layout/public.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Spring Boot and Thymeleaf - Thymeleaf Layout Dialect 5 | 6 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | SB Admin v2.0 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | Blank 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /springbootsample/src/main/webapp/views/signin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Spring Boot and Thymeleaf Integration Sample 5 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Please sign in 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | Remember Me 33 | 34 | 35 | Sign in 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /springbootsample/src/test/java/com/mysample/AppTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package com.mysample; 18 | 19 | import org.junit.Test; 20 | import org.junit.runner.RunWith; 21 | import org.springframework.boot.test.SpringApplicationConfiguration; 22 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 23 | import org.springframework.test.context.web.WebAppConfiguration; 24 | 25 | import com.mysample.springbootsample.App; 26 | 27 | /** 28 | * Unit test for simple App. 29 | */ 30 | @RunWith(SpringJUnit4ClassRunner.class) 31 | @SpringApplicationConfiguration(classes = App.class) 32 | @WebAppConfiguration 33 | public class AppTest { 34 | 35 | @Test 36 | public void contextLoads() { 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /springbootsample/src/test/java/com/mysample/UserRepositoryTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 Brient Oh @ Pristine Core 3 | * boh@pristinecore.com 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package com.mysample; 18 | 19 | import static org.junit.Assert.assertEquals; 20 | import static org.junit.Assert.assertNotNull; 21 | import static org.junit.Assert.assertNull; 22 | 23 | import java.util.HashSet; 24 | import java.util.Set; 25 | 26 | import org.junit.Test; 27 | import org.junit.runner.RunWith; 28 | import org.springframework.beans.factory.annotation.Autowired; 29 | import org.springframework.boot.test.SpringApplicationConfiguration; 30 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 31 | import org.springframework.transaction.annotation.Transactional; 32 | 33 | import com.mysample.springbootsample.config.RepositoryConfig; 34 | import com.mysample.springbootsample.domain.Address; 35 | import com.mysample.springbootsample.domain.User; 36 | import com.mysample.springbootsample.repository.UserRepository; 37 | 38 | @RunWith(SpringJUnit4ClassRunner.class) 39 | @SpringApplicationConfiguration(classes = {RepositoryConfig.class}) 40 | public class UserRepositoryTest { 41 | 42 | @Autowired 43 | private UserRepository userRepository; 44 | 45 | @Test 46 | @Transactional 47 | public void testSaveUser() { 48 | User user = new User(); 49 | user.setUsername("boh"); 50 | user.setPassword("123456"); 51 | 52 | Set addressSet = new HashSet(0); 53 | Address adminAddr1 = new Address(); 54 | adminAddr1.setAddress1("Street Address 1-1"); 55 | adminAddr1.setAddress2("Street Address 1-2"); 56 | adminAddr1.setAddrCity("Los Angeles"); 57 | adminAddr1.setAddrState("CA"); 58 | adminAddr1.setZipCode("90001"); 59 | adminAddr1.setUser(user); 60 | addressSet.add(adminAddr1); 61 | 62 | Address adminAddr2 = new Address(); 63 | adminAddr2.setAddress1("Street Address 2-1"); 64 | adminAddr2.setAddress2("Street Address 2-1"); 65 | adminAddr2.setAddrCity("Los Angeles"); 66 | adminAddr2.setAddrState("CA"); 67 | adminAddr2.setZipCode("90002"); 68 | adminAddr2.setUser(user); 69 | addressSet.add(adminAddr2); 70 | 71 | user.setAddressSet(addressSet); 72 | 73 | assertNull(user.getUserId()); 74 | userRepository.save(user); 75 | assertNotNull(user.getUserId()); 76 | 77 | User fetchedUser = userRepository.findOne(user.getUserId()); 78 | 79 | assertNotNull(fetchedUser); 80 | assertEquals(user.getUserId(), fetchedUser.getUserId()); 81 | 82 | System.out.println("TEST1: " + fetchedUser.getUsername()); 83 | System.out.println("TEST2: " + fetchedUser.toString()); 84 | } 85 | } 86 | --------------------------------------------------------------------------------
You don't have a permission to access this page.
Page not found.
There is internal server error.