Friday, June 11, 2010

Chapter 4 - advanced Spring - continued again...

Ok, I just read a couple of more sections in chapter 4. One on internationalization, the other on event publishing. Next up is property editing. Ok, just read property editing. Basically, you specify a bean to handle date editing, using a CustomDateEditor provided by spring. Then, you set up a CustomEditorConfigurer that takes a map of each of the beans specified for property handling. Then you can just specify the date and value in you application bean params.

Ok. Finished reading chapter four. Now let's try to run the code.

What do we have?

C:\tutorials\springrecipes\Chapter04\Shop

Let's import the project.

Bam. Got it.

Bunch of stuff. Errors on annotation. Set the java level to 5.

Wow, works on first try:

***********************
* Welcome to My Shop! *
***********************
Shopping cart 1 contains [AAA 2.5, CD-RW 1.5]
Shopping cart 2 contains [DVD-RW 3.0]
A shopping cart costing 4 dollars has been checked out at 6/11/10 8:07 AM.
Checkout event [4.0, Fri Jun 11 08:07:44 EDT 2010]
Product ranking from Sat Sep 01 00:00:00 EDT 2007 to Sun Sep 30 00:00:00 EDT 2007

Let's comment the code...

Ok, done.

No comments:

Post a Comment