25.02.2015 Views

Introducing Spring Framework

Introducing Spring Framework

Introducing Spring Framework

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 3 ■ Applying Different Configurations<br />

document = new Document();<br />

document.setName("Clustering with RabbitMQ");<br />

document.setType(type);<br />

document.setLocation("/Users/felipeg/Documents/Random/Clustering with RabbitMQ.txt");<br />

result.add(document);<br />

type = new Type();<br />

type.setName("WEB");<br />

type.setDesc("Web Link");<br />

type.setExtension(".url");<br />

document = new Document();<br />

document.setName("Pro <strong>Spring</strong> Security Book");<br />

document.setType(type);<br />

document.setLocation("http://www.apress.com/9781430248187");<br />

result.add(document);<br />

}<br />

}<br />

return result.toArray(new Document[result.size()]);<br />

Next, let’s take a look at Listing 3-10. It shows your XML configuration file and the necessary tags that will tell<br />

the <strong>Spring</strong> container to look for annotated classes and their annotations. In this file, you are using a special tag:<br />

. This tag belongs to an XML namespace that is also declared on your<br />

configuration. This new namespace will add more tags that you will see in the following chapters of the book. For now,<br />

this tag will instruct the <strong>Spring</strong> container to start looking for annotated classes from the package specified, in this case<br />

"com.apress.isf.spring.annotated" and all subpackages.<br />

Listing 3-10. Mydocuments-annotations-context.xml<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

36

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!