Page 17, "For example, using Spring’s SimpleJdbcTemplate ...". Well, SimpleJdbcTemplate has been deprecated since Spring 3.1, just use JdbcTemplate instead (as mentioned in the first pages, the book is intended to get readers quickly up and running, not make them use outdated classes ...)
On page 176 the name of properties file for Spanish locale is ValidationErrors_es.properties while the name of default file is ValidationMessages.properties.
The basename should be the same for both files.
Page 413 very last sentence of chapter 15.5.1 ends with "don’t support this type of endpoint publication and thus can’t be used with SimpleJaxWsServiceEndpoint".
I think it should be : "don’t support this type of endpoint publication and thus can’t be used with SimpleJaxWsServiceExporter"
On Chapter 2, page 62 there's an example of importing a JavaConfig class from xml config. However, there is something very important missing. You need to add <context:annotation-config/> to the xml or else it won't work. As a non-expert in Spring, that's one of the errors I've come across in this book that really threw me for a loop.
Section 16.5 Summary in Chapter 16 Creating REST APIs with Spring MVC states, "Coming up in the next chapter, you’ll start locking them down, as we look at ways to secure the REST resources so that only authorized clients are allowed to consume them." However, the title of Chapter 17 is Messaging in Spring and does not discuss REST security at all. Chapter 9 Securing Web Applications also does not discuss REST. Is Spring in Action missing a chapter on REST security?
I have two questions after being through 3/4 of the book:
why is there no JavaConfig examples in chapter 17 (Messaging in Spring) ? (Almost always the tone is: "i like java config more")
why is there no explanation of how to secure websocket connections in chapter 18 ? (I am still trying to figure out how to do that with the sparse info I find online)
First of all, I love this book, I just want to help improving on the next installement:
Usage of @Inject (I know this is a detail) The Introduction talks about using consistently @Autowired over @Inject but still on page 300 and 310 it is used (even the Index mentiones those pages for it)
Broken Listing 11.1 (page 309) Either the Listing just shows a part of the Repository class (I don't think it is supposed to) then there is an additional closing curly braket at the end too much.
Or the header of the class is missing and the indentation of the constructor (the listing actually starts with the c'tor) is wrong.
The code does not run no matter what path you try. I even tried
C:\something
Don't you have to create the directory first?
you get the error below...
root cause
org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [C:\Users\jokra_000\sts-bundle\pivotal-tc-server-developer-3.1.1.RELEASE\base-instance\work\Catalina\localhost\spittr\tmp\spittr\uploads] is not valid
Has anyone successfully uploaded an image file as outlined in Chapter 7 ? It seems there's far more to it than what's decribed.
The code Craig supplied does not run here.... crashes and will not upload a file.
Any suggestions on how to implement MultipartFile and the Path...
Craig suggests just....
in AbstractAnnotationConfigDispatcherServletInitializer...
Page 62, Section 2.5.2:
For example, you could leave the CDConfig bean out of the previous XML configuration and instead have a third configuration file that joins them
should be
For example, you could leave the CDPlayer bean out of the previous XML configuration and instead have a third configuration file that joins them
Another option worth considering is that you could change Spitter so that it implements UserDetailsService. By doing that, you could return the Spitter directly from the loadUserByUsername() method without copying its values into a User object.
I think this should say:
Another option worth considering is that you could change Spitter so that it implements UserDetails. By doing that, you could return the Spitter directly from the loadUserByUsername() method without copying its values into a User object.
Susan Harkins wrote:Please share post-publication errata in this folder. We'll compile and publish a comprehensive list for everyone's convenience.
Thank you!
Susan Harkins
Errata Editor
On page 59 last paragraph on page "What you could do is break out the BlankDisc bean from CDPlayerConfig into its own CDConfig class
The preceding examples had CompactDisc in the javaconfig file, not BlankDisc, and indeed the example goes on to show how CompactDisc is broken out to class CDConfig (not the BlankDisc)
Post Publication Errata: p. 106 AspectJ pointcut expression * vs **
I'm new to AOP and asking about a possible problem in Spring In Action 4e.
Sec 4.2.2 on p. 106 shows a pointcut expression "* concert.Performance.perform()". Note single asterisk.
Sec 4.3.1 also on p. 106 uses a pointcut expression "** concert.Performance.perform(..)". Note double asterisk.
I believe the first one is correct, and suspect the second might be a typo. My brief searches could not turn up any use of two asterisks, except if trying match *all* methods, using a second asterisk as a wildcard. But this expression lists a class and method.
I see that the errata page was last updated 2015. Maybe this is for nothing. Anyhow please check, thanks for listening.
On page 82, section 3.4.1, the example shows annotations on a cart() method:
@Component
@Scope(
value=WebApplicationContext.SCOPE_SESSION,
proxyMode=ScopedProxyMode.INTERFACES)
public ShoppingCart cart() { ... }
My understanding is the @Component annotation is a class-level annotation only, so it can't be on a method.
So change the example to annotating a @Bean definition in a Java Config class (which is probably what was intended), e.g.:
@Configuration
public class ShopConfig {
...
@Bean
@Scope(
value=WebApplicationContext.SCOPE_SESSION,
proxyMode=ScopedProxyMode.INTERFACES)
public ShoppingCart cart() { ... }
...
Alternatively, annotate a class. Note that since the proxyMode is INTERFACES, I believe ShoppingCart must be an interface. e.g.:
public interface ShoppingCart {...}
...
@Component
@Scope(
value=WebApplicationContext.SCOPE_SESSION,
proxyMode=ScopedProxyMode.INTERFACES)
public class MyShoppingCart implements ShoppingCart { ... }
Re. the LiveBook exercise in section 3.5.1. When I submit what I'm confident are the correct answers, it marks them all wrong. If you click on "Show Answer", what it purports are the correct answers are actually all wrong. See attachments for details.