Meu css não funciona, a todas as páginas estão bloqueadas, podem me ajudar por favor?
Obs. Quando estou logado o css funciona.
meu loginForm esta dentro de view
loginForm
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Livros de Java, Android, iPhone, Ruby, PHP e muito mais - Casa do Código</title>
<c:url value="/resources/css" var="cssPath" />
<link rel="stylesheet" href="${cssPath}/bootstrap.min.css" />
<link rel="stylesheet" href="${cssPath}/bootstrap-theme.min.css" />
<style type="text/css">
body {
padding: 60px 0px;
}
</style>
</head>
<body>
<div class="container">
<h1>Login Casa do Código</h1>
<form:form servletRelativeAction="/login" method="post">
<div class="form-group">
<label>Nome</label> <input type="text" name="username"
class="form-control" />
</div>
<div class="form-group">
<label>Senha</label> <input type="password" name="password"
class="form-control" />
</div>
<button type="submit" class="btn btn-primary">Logar</button>
</form:form>
</div>
</body>
</html>
LoginController
package br.com.casadocodigo.loja.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
public class LoginController {
@RequestMapping(value="/login", method=RequestMethod.GET)
public String loginForm(){
return "loginForm";
}
}
SecurityConfiguration extends
package br.com.casadocodigo.loja.conf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import br.com.casadocodigo.loja.daos.UsuarioDAO;
@EnableWebMvcSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Autowired
private UsuarioDAO usuarioDAO;
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/produtos/form").hasRole("ADMIN")
.antMatchers("/carrinho/**").permitAll()
.antMatchers(HttpMethod.GET, "/produtos").permitAll()
.antMatchers(HttpMethod.POST, "/produtos").hasRole("ADMIN")
.antMatchers("/produtos/**").permitAll()
.antMatchers("/resources/**").permitAll()
.antMatchers("/").permitAll()
.anyRequest().authenticated()
.and().formLogin().loginPage("/login").permitAll()
.and().logout().logoutRequestMatcher(new AntPathRequestMatcher("/logout"));
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(usuarioDAO)
.passwordEncoder(new BCryptPasswordEncoder());
}
}
