Here we are, the last day of our Apache Wicket series. While there was only one day that focused on Apache Wicket, we’ve laid the groundwork needed to get a J2EE project that uses a web framework off the ground. And step-by-step, if you follow along with the team on all 4 days preceding, you will have a greater understanding of how everything is put together, and why.
And as you can see, the actual work that went into the front-end of MysticPaste, didn’t take very long at all. And as good community citizens, we’ve made the finished product and source code available.
MysticPaste.com – our implemented pastebin based on the code examples and tutorials shown throughout this series
MysticPaste Source – the source code for the pastebin, open source.
On Day 1, we learned the many steps it takes to put together a project that can be worked on in a team environment. We’ve enjoyed your comments on different methodologies, and some we will definitely take into account. The biggest thing to take away from that day, is to understand the underpinnings of why things are where they are in a project, and how adherence to the fairly accepted Maven standard structure can make life much much easier.
On Day 2, we ran through some basics on Mocks, and with a bit of upfront design on interfaces, a testing harness is available for building out the backend. We also learned how to take Unitils and extend our tests passed just a functional unit, and move through many layers of the built system, and ensure we go a bit beyond just code coverage.
On Day 3, with unit tests in place, we felt safe writing some implementations so we moved the codebase from failing tests due to no implementation, to working tests. We learned a bit about designing your domain model based on requirements and design discussions, and molding the service and persistence layer to support your business goals.
On Day 4, we got to the most exciting part of our journey, Apache Wicket. The article walked you through some of the basics of putting a page together using markup inheritance, and amazingly enough, how this simple act removes the need for technology so common in the MVC world to support this. Best of all, because its all in Java, ultimately you can actually use your IDE and refactor or debug as needed. Each of the most basic components with forms, and display, and the wicket-based tags that act as extensions to your HTML pages, were reviewed with links off to the Javadoc for further discovery. One of the many reasons to love Wicket, is the clear separation of functional concerns, no code in your template pages, it’s just HTML.
If you’re like the members of the Mystic team, you will CRAVE more. More information, more discovery into how we can fully integrate Apache Wicket as a tool in our arsenal. Aside from downloading the distribution and following along with our tutorial, here are some options ahead:
With the concepts in these articles, we’ve laid the groundwork for many more short articles on interesting technology in the future. There is definitely a lot of new and interesting items we can add to MysticPaste without overcomplicating the streamlined interface, such as:
[...] Day 5 – Putting it all together [...]
Hello, very nice article. I am having problem downloading the source as I am being ask for a username / password using subversion client. Can you tell me how to get code.
Thanks
There is no subversion repository support at kenai for this particular project.
If you’re on Windows, use cygwin and “hg” (Mercurial) to get a clone of the code, like so:
$ hg clone https://kenai.com/hg/mystic-apps~mystic-apps
Enjoy!
[...] Day 5 – Putting it all together [...]
Hey.
Thanks a lot for this tutorial series, it has helped me a great deal. I’ve created my own project following the steps in this tutorial and by looking at your github repository.
Everything builds fine and I get no errors when I run mvn tomcat:run and so on, but when I try to submit the PasteForm my pasteService object is null. I have verified that I have
“@SpringBean
PasteService pasteService;”. My applicationContext.xml is also the same as the one you’ve made.
Any help is greatly appreciated.
Follow-up:
The NullPointerException occurs when trying to save the PasteItem object in the PasteForm#onSubmit() method.
“pasteService.createItem(pasteItem);”
Yikes! Three comments in ~ 10 minutes.
Figured it out, I had of course remembered to do everything except adding the component instantiation listener for Spring
Sorry!
Hi, I’m having trouble running your example, I got this error
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘pasteService’ defined in class path resource [com/mysticcoders/mysticpaste/spring/applicationContext.xml]: Cannot resolve reference to bean ‘pasteItemDao’ while setting bean property ‘itemDao’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘pasteItemDao’ defined in class path resource [com/mysticcoders/mysticpaste/spring/applicationContext.xml]: Cannot resolve reference to bean ‘sessionFactory’ while setting bean property ‘sessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory’ defined in class path resource [com/mysticcoders/mysticpaste/spring/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javassist/util/proxy/MethodFilter
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
If someone can help, I will apreciate it a lot
Hi, i had the same problem. You need to choose profile as DEV. It will work.
[...] Interesting 5-part tutorial by Mystic Coders [...]
[...] Interesting 5-part tutorial by Mystic Coders [...]