60472 (2) [Avatar] Offline
#1
The login feature doesn't work for me.

The
.formLogin()
.loginPage("/login")
code in SecurityConfig.java is doing its thing, so when I surf to localhost:8080,
it redirects to localhost:8080/login. But it's still displaying the readinglist.html
template.
The only controller defined in the app is ReadingListController.java.
For comparison I worked through https://spring.io/guides/gs/securing-web/, which
works by defining the /login controller in a file called MvcConfig.java:
@Configuration
public class MvcConfig extends WebMvcConfigurerAdapter {

@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/home").setViewName("home");
registry.addViewController("/").setViewName("home");
registry.addViewController("/hello").setViewName("hello");
registry.addViewController("/login").setViewName("login");
}
}
But I can't find the /login controller definitions anywhere in Chapter 3.
So, is there some other Spring Boot magic I'm overlooking, or does this just
not work?
373794 (1) [Avatar] Offline
#2
Same here. I wish the author would update the book and fix the errors. Do they not run the code even once before publishing the book? I was very happy with my Spring in Action purchase but this book has been a disappointment so far.
321728 (4) [Avatar] Offline
#3
This is still the case in the published book.

I'm very disappointed - usually Manning publications are high quality.
395909 (1) [Avatar] Offline
#4
I have the same problem. There are a few months now and they dont care abaout our dissappointment. .... Criminals, they took our money and everithing is good now. Others can not be said