Susan Harkins (203) [Avatar] Offline
#1
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
239694 (1) [Avatar] Offline
#2
7.5 Carrying data across redirect requests
Contains unresolved references on pages 213-214:
XREF _writing_a_form_handling_controller
XREF ex_SpitterController_processRegisration_validation
348343 (4) [Avatar] Offline
#3
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 ...)
348343 (4) [Avatar] Offline
#4
Page 44 chapter 2.3.2:
By default, the bean will be given an ID that is the same as the @Bean-annotated
method’s name. In this case, the bean will be named compactDisc.

As method's name is sgtPeppers(), bean name will be sgtPeppers, not compactDisc.
Ozren Harlovic (18) [Avatar] Offline
#5
Chapter 4 -
Figure 4.9. Instead of a JudgeAspect, there should be a CriticAspect shown in the figure (page 126)
348343 (4) [Avatar] Offline
#6
Page 56, chapter 2.4.4 "Setting properties", in figure 2.2:
c:compactDisc-ref="compactDisc"

instead of p:compactDisc-ref...
348343 (4) [Avatar] Offline
#7
Page 62 chapter 2.5.2 "Referencing JavaConfig in XML configuration":

Now, suppose that instead of configuring BlankDisc in XML, you want to configure it
in XML while leaving the CDPlayer configuration in JavaConfig.


... looks like it should be rephrased to :

Now, suppose that instead of configuring BlankDisc in XML, you want to configure it
in JavaConfig while leaving the CDPlayer configuration in XML.

360290 (1) [Avatar] Offline
#8
In listing 5.9, the SpittleController is declared twice:

SpittleController controller =
          new SpittleController(mockRepository);
  SpittleController controller =
         new SpittleController(mockRepository);
259897 (2) [Avatar] Offline
#9
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.
236231 (2) [Avatar] Offline
#10
Page 383 : text says "But first, you’ll need to enable them by setting @EnableGlobalMethodSecurity’s prePostEnabled attribute to true:"

Still, in code example, that annotation is missing :
@Configuration
public class MethodSecurityConfig extends GlobalMethodSecurityConfiguration {
}


It should be :
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled=true)
public class MethodSecurityConfig extends GlobalMethodSecurityConfiguration {
}
236231 (2) [Avatar] Offline
#11
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"
317083 (1) [Avatar] Offline
#12
Page 42

import org.junit.contrib.java.lang.system.StandardOutputStreamLog;

For StandardOutputStreamLog has been Deprecated,should update to
import org.junit.contrib.java.lang.system.SystemOutRule;


CDPlayerTest.java
public final StandardOutputStreamLog log=new StandardOutputStreamLog();

should update to
public final SystemOutRule systemOutRule = new SystemOutRule().enableLog();


We also need to update the pom.xml
<dependency>

    <groupId>com.github.stefanbirkner</groupId>

    <artifactId>system-rules</artifactId>

    <version>1.12.0</version>

</dependency>
jrw (2) [Avatar] Offline
#13
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.
Derek Mahar (2) [Avatar] Offline
#14
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?
Stephan Dilly (2) [Avatar] Offline
#15
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)
  • Stephan Dilly (2) [Avatar] Offline
    #16
    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.
    jokrasa (15) [Avatar] Offline
    #17
    7.2. Processing multipart form data

    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...

    @Override
    protected void customizeRegistration(Dynamic registration) {
    registration.setMultipartConfig(
    new MultipartConfigElement("/tmp/spittr/uploads", 2097152, 4194304, 0));
    }

    in Controller processRegistration....

    MultipartFile profilePicture = spitterForm.getProfilePicture();
    profilePicture.transferTo(new File("/tmp/spittr/" + spitter.getUsername() + ".jpg"));


    Regards, Johnny O
    Paulied (1) [Avatar] Offline
    #18
    On page 35:

    The second listing title currently reads
    "Listing 2.2 @CompactDisc-annotated SgtPeppers implements CompactDisc"

    and should read
    "Listing 2.2 @Component-annotated SgtPeppers implements CompactDisc"

    Love the book!
    Michael Piefel (1) [Avatar] Offline
    #19
    Chapter 3.1.1, Configuring profile beans

    The JavaConfig examples all use javax.activation.DataSource when they should use javax.sql.DataSource instead.

    The XML examples, of course, are correct, demonstrating once more how superior JavaConfig is.
    sainaen (1) [Avatar] Offline
    #20
    The source code for RootConfig on page 138 has a typo:
    instead of
    @ComonentScan(basePackages={"spitter"},
    should be
    @ComonentScan(basePackages={"spittr"},
    (with correct package name.)
    413851 (3) [Avatar] Offline
    #21
    Page 145, Listing 5.9

    SpittleController controller = new SplittleControler(mockRepository)
    is printed twice
    413851 (3) [Avatar] Offline
    #22
    Chapter 3 Advanced Wiring
    Section Addressing ambiguity in autowiring
    Section Scoping beans

    I strongly feel, these two should be in Chapter 2. Wiring beans
    413851 (3) [Avatar] Offline
    #23
    Page 309
    11.1.2 Building Spring-free Hibernate
    Listing 11.1
    Text talks about @Inject, @Repository annotation.
    But listing doesn't show them
    417843 (1) [Avatar] Offline
    #24
    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
    200341 (1) [Avatar] Offline
    #25
    Page 260, chapter 9 - "Securing web applications"

    The end of section 9.2.4 says:
    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.
    444571 (1) [Avatar] Offline
    #26
    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)
    449785 (1) [Avatar] Offline
    #27
    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.