11
2006
DWR + Spring = Ajax Sudoku Puzzle
There is so much to love about DWR and Spring integration. Just configure up your dwr.xml and tell it which spring beans you want to expose for Ajax goodness, and which methods you want to expose on them.
In preparation for a talk I’m giving Wednesday night to the Canberra JUG, I’ve added Ajax goodness to my little
Spring-powered Sudoku solver. And it was a total snack. You can double click on individual cells to solve just that square, or use the “Solve” button to solve the whole puzzle. You could probably write a better one entirely in Javascript (other people have), but it does serve as a great example of using Spring IoC, AOP, ORM, and Unit testing support.
Check it out (source available here soon). And if you’re in the Australian capital this Wednesday night, drop into the Sun offices on Northbourne from 6PM for Pizza, Beer and a fun introduction to Spring (and if you’re not into Spring, just come for the Sudoku solving
.
4 Comments + Add Comment
Leave a comment
Glen Smith
Archives
- April 2012
- March 2012
- January 2012
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- April 2011
- March 2011
- January 2011
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- May 2005
- April 2005
- March 2005
- February 2005
- January 2005
- December 2004
- November 2004
- October 2004
- September 2004
- August 2004
- July 2004
- June 2004
- May 2004
- March 2004
- February 2004
- January 2004
- December 2003
- November 2003
- October 2003
- September 2003

An article by Glen





I too am writting an app with DWR and Spring I just love it. Thanks for your example. I’m also using your CSV parser, so thanks a bunch.
I’m not 100% convinced that sudoku solver is correct. Peek at the following solution I generated by hitting Get A Puzzle then Solve: http://www.srcf.ucam.org/~cjp39/sudoku-broken.gif
Not convinced it’s adhering to the “digits must be unique in each row, cell and column” rule ‚Äî and if it’s not adhering to *that*, which is almost the only rule of Sudoku, how can one call it a Sudoku solver?
Chris, thanks for your feedback. I think this one is more of a browser render issue. If the solver can’t solve a puzzle (and it can’t solve the ones marked evil) – it will shortlist candidates down to the possible numbers for that cell. It seems on your browser is only displays the first “candidate” – some of those cells actually contain a few numbers.
Anyways, here’s a grab of same puzzle on my Mac which makes the problem a little clearer. What the UI should probably do is colour the cells that it couldn’t solve to give better cues that the cell still needs work.
For those interested, the source to the webapp is now available in the downloads section. Look for the files marked spring-cjug-talk-*. There are versions with or without the supporting spring/velocity/sitemesh libs to make downloads a little snappier for those just interested in the sudoku stuff.