Dynamic dropdowns with extjs using servlets and json-lib
If you have not discovered extjs yet, then you are missing out. I’ve been working with extjs for a couple of months now, and I am very happy with the results — and so are the customers. There are a number of advantages to using Javascript UI components for your web application including:
- you do not have to recompile after every change (just hit reload)
- it does not matter what backend framework you are using — you just need to be able to post and retrive JSON or XML data
- it does not matter what view you are using (Freemarker, Velocity, JSP’s, etc)
- json-lib makes working with json-lib easy
- you can do a lot more functionality with a lot less code
The demo shows how to easily do dyanmic drop down boxes with extjs and using servlets to provide the JSON. I used json-lib to create the JSON.
Here are a couple of images of the demo. Just unzip the archive, run “mvn jetty:run”, and go to http://localhost:8080/. You have to have Maven 2 already installed and setup. I have a number of other examples on using extjs with Java including a nice tree reordering demo where I save the nodes to a Hibernate backend that I will try to find some time to post.


aalmiray:
Eirc, I’m glad that you found Json-lib useful for your project, keep it up!
September 22, 2007, 8:10 pmkrishna:
link not working, any other place where I can find examples or sources of using json-lib?
October 1, 2008, 1:08 am