Showing posts with label gwt. Show all posts
Showing posts with label gwt. Show all posts

Friday, December 5, 2008

Spring by Example Wins

I was going to really try to get back into working on the book, but I think I realistically don't have the time. I did make a small update to Spring In-depth, In Context before SpringOne started, but I was thinking about how Spring 3.0 is coming out soon so I would need to go through everything again. Posting examples on Spring by Example is less effort since each example is more or less standalone and I'm primarily writing up something specifically on the example. Instead of trying to explain the subject completely, which involves a lot more research and effort. Maybe one day I'll try to get back into working on it, but I actually think hands on examples are probably more valuable. At least that what I always like to see. I typically just want to get going on a project and I'll learn all the nuances of the technology as I go. Possibly the preface and intro from the book can become part of the Spring by Example documentation at some point.

Based on this decision I moved the work I had done for the book to Spring by Example.

Tuesday, December 2, 2008

Spring by Example & 'Spring In-depth, In Context'

I've made updates to both sites. Spring by Example doesn't have anything too major, but the last site release updated the Spring by Example Web Module to version 1.1.1. For Spring In-depth, In Context, I finally had time to get the Chat and Trade Monitor examples I made for my SpringOne presentation posted and written up for Jetty. The examples are checked in except for the Trade Monitor example running an embedded Jetty in Tomcat. This is the same as the Trade Monitor that runs under Jetty, was just to show that you could still use Jetty's Bayeux implementation even if you were on Tomcat.

Also I finally had time to post a simple Spring dm Server example showing side-by-side versioning. It has a version 1.0 and 1.1 of a message service. The version 1.0 uses Commons Lang 2.1.0 and version 1.1 uses Commons Lang 2.4.0. There is a web module that just displays the data and you can switch back and forth between the two different message services at runtime. I'll work on this section more to add screen shots and a more detailed explanation of things, but I wanted to get what was ready posted.


Sunday, October 26, 2008

GWT & Comet Spring Integration

I'm making good progress integrating GWT & Comet with Spring. I just posted an update to the Spring by Example Web Module for a basic Spring GWT Controller and Spring Bayeux configuration for Comet on Jetty. Basically there is a Spring version of the Bayeux implementation and can configure it completely in Spring. Then it can be injected into BayeuxService implementations and there is a servlet that gets Bayeux from Spring instead of creating it. I think I'll possibly have a GWT version of the Dojo Comet Chat example soon.

Saturday, August 2, 2008

Simple GWT Spring Webapp Example

I finally had time to finish up the GWT example I've been working on. I may add a bit more to it in the future (like an autocomplete search widget), but there is a lot there and should be helpful getting people started integrating GWT with Spring.
My general impression of using GWT is positive. It's definitely nice that you can work in Java and all the JavaScript is generated for you. Especially that it should perform well and work in different browers. It's a little tedious keeping everything in sync between the static servlet I use when running GWT in debug mode (avoids integrating Spring and injection into GWT debug) and the Spring controller. Also to have GWT use the main message resource for internationalization, a JavaScript object has to be maintained on the static HTML and JSP page (GWT debug vs. Spring webapp). It also wasn't obvious that if I made a bean to use with the main GWT entry point class that it had to be in the same package or a subpackage.

Also, as a side note, I have the person form working using Spring JS. It isn't too much work once I realized that it was working, but Spring Web Flow was refreshing the page afterword until I added at the end of the 'save' transition a render element specifying to only update the 'content' fragment. Otherwise only the 'onclick' attribute of the save button has to be modified.


<input type="submit" id="save"
       name="_eventId_save" value="<fmt:message key="button.save">"
       onclick="Spring.remoting.submitForm('save', 'person', {fragments:'content'}); return false;"/>


You currently can't specify a target div for returned fragments. I filed a JIRA (Enhance AjaxEventDecoration in Spring JS to specify a Target Div) to allow a targetId. Ideally it will be a list like fragments so you can specify what fragment goes with what div. I wanted to be able to have menu links refresh the content div without refreshing the entire page. Current funtionally assumes that you would just use AJAX for updates within functional areas. Like, I'm on the person page and want to just update the messages and personForm divs with fragments. So the fragment is expected to be wrapped in the div that is already is on the page and they are automatically matched up and updated. I think it will be a useful feature and hopefully will get added in an upcoming release.

Sunday, July 27, 2008

Spring by Example JDBC, Spring Dynamic Tiles Module, and Google Web Toolkit

I almost have everything ready to post a simple Google Web Toolkit (GWT) example with Spring. I have everything checked in and I also had to update Spring by Example JDBC and Spring by Example Dynamic Tiles Module.

Spring by Example JDBC version 1.0.3 was upgraded to match changes in Spring 2.5.5 and HsqldbInitializingDriverManagerDataSource & InitializingDriverManagerDataSource were changed to use SimpleDriverDataSource (which was added in Spring 2.5.5).

Spring by Example Dynamic Tiles Module 1.1 has a number of changes. The project was updated to use Spring 2.5.5, AJAX support like Spring JS and Spring Web Flow is provided, and a few other items (see release notes in the projects README.txt). Also, Spring by Example Dynamic Tiles Module 1.0 was compiled with Java 6, but should have been compiled with Java 5. The projects are basically all ready, but just need a little more testing. Although everything is checked into Subversion.

I'll try to get everything finalized and checked in over the next couple of days. I think the AJAX support that works with Spring JS' Spring.remoting.submitForm is great. It's really nice to have simple and easy control over updating specific div sections that match parts of a Tiles template.