Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SecurityConfiguration.java
- @Override
- protected void configure( HttpSecurity http )throws Exception
- {
- http.authorizeRequests().antMatchers ( "/resources/**" ).permitAll()
- .antMatchers ( "/admin" ).hasRole( "ADMIN" )
- .antMatchers ( "/topics/**" ).permitAll()
- .antMatchers ( "/login" ).hasRole( "USER" )
- .anyRequest ()
- .authenticated ()
- .and ()
- .formLogin ()
- .loginPage ( "/hello-world" ).permitAll()
- .and ()
- .logout ()
- .logoutRequestMatcher( new AntPathRequestMatcher( "/logout" ) );
- }
- AppWebConfiguration.java
- @Override
- public void addResourceHandlers( ResourceHandlerRegistry registry )
- {
- registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
- }
- page.tag
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
- <!--<spring:url value = "/resources/css/main.css" var = "main" />
- <spring:url value = "/resources/css/home_nocache.css" var = "home_nocache" />
- <link href="${main}" rel="stylesheet" type="text/css">
- <link href="${home_nocache}" rel="stylesheet" type="text/css">-->
- <!--<link href="${homeLess}" rel="stylesheet" /> -->
- <link href= "<c:url value='/resources/css/main.css' />" rel="stylesheet" ></link>
- <link href= "<c:url value='/resources/css/home_nocache.css' />" rel="stylesheet" ></link>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
- <style type="text/css"></style>
- </head>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement