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 14 ■ Using Dynamic Languages<br />

<br />

<br />

class GroovyLoginService<br />

def setUsername(email)<br />

@username = email<br />

end<br />

def setPassword(pass)<br />

@password = pass<br />

end<br />

def isAuthorized(email,pass)<br />

if @username == email and @password == pass<br />

return true<br />

else<br />

return false<br />

end<br />

end<br />

end<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Listing 14-8 shows you the tag; here you are putting Ruby code inline, and it will work the same as<br />

the Groovy language. Listing 14-9 shows the Bean Shell language.<br />

Listing 14-9. mydocuments-context.xml<br />

<br />

<br />

<br />

201

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

Saved successfully!

Ooh no, something went wrong!