Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. SecurityConfiguration.java
  2.  
  3. @Override
  4. protected void configure( HttpSecurity http )throws Exception
  5. {
  6. http.authorizeRequests().antMatchers ( "/resources/**" ).permitAll()
  7. .antMatchers ( "/admin" ).hasRole( "ADMIN" )
  8. .antMatchers ( "/topics/**" ).permitAll()
  9. .antMatchers ( "/login" ).hasRole( "USER" )
  10. .anyRequest ()
  11. .authenticated ()
  12. .and ()
  13. .formLogin ()
  14. .loginPage ( "/hello-world" ).permitAll()
  15. .and ()
  16. .logout ()
  17. .logoutRequestMatcher( new AntPathRequestMatcher( "/logout" ) );
  18. }
  19.  
  20. AppWebConfiguration.java
  21.  
  22. @Override
  23. public void addResourceHandlers( ResourceHandlerRegistry registry )
  24. {
  25. registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
  26. }
  27.  
  28.  
  29. page.tag
  30.  
  31. <head>
  32. <meta charset="utf-8">
  33. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  34. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  35.  
  36. <!--<spring:url value = "/resources/css/main.css" var = "main" />
  37. <spring:url value = "/resources/css/home_nocache.css" var = "home_nocache" />
  38. <link href="${main}" rel="stylesheet" type="text/css">
  39. <link href="${home_nocache}" rel="stylesheet" type="text/css">-->
  40.  
  41. <!--<link href="${homeLess}" rel="stylesheet" /> -->
  42.  
  43. <link href= "<c:url value='/resources/css/main.css' />" rel="stylesheet" ></link>
  44. <link href= "<c:url value='/resources/css/home_nocache.css' />" rel="stylesheet" ></link>
  45.  
  46. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  47.  
  48. <style type="text/css"></style>
  49. </head>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement