Skip to content

State/survey of GWT widgets

GWT does not provide as near a complete set of widgets with GWT as, say, YUI. It does provide a way to integrate existing javascript widgets, as the gwt-ext and gwt-widget projects do. However, this approach is lacking compared to native GWT widget sets because

  1. They require external javascript source files, which you then have to version and your user has to download (even if you only use some of the code). These files are not subject to the GWT optimization/compilation process.
  2. The JSNI methods used to access the third party widgets can cause trouble when you’re debugging in hosted mode. See one example.

I think it would be worth the GWT team taking more action to standardize the GWT widget set. Yes, the incubator is a start, but some of the widgets there are months old. Among other things, I could not find a carousel component that didn’t depend on kilobytes of external YUI javascript.

Here’s an informal list of GWT widget toolkits that I’ve found in my searches. Most I’ve tried and found useful, some I just have looked at. Some are native, some are wrappers.

  • The GWT incubator: these are widgets, as well as documents and other tools, that might make it into GWT in the future.
  • gwt-widget: I’ve used this project in the past. Some wrappers (of scriptaculous) and some native classes (SimpleDateFormat, LightBox).
  • sphene: I like the slider and am planning to use it in a project very soon.
  • GWT-Rocket: This provides a whole framework, including many widgets and some replacements for core GWT functionality. I installed and tested their slider functionality, but haven’t looked closer than that.
  • gwt-ext: This project wraps the fine extjs js library, plus more if you pay. I have used this for grid tables and found it great.
  • ext-gwt: This project apparently re-implements extjs, by the folks who wrote extjs. Here’s more about the differences between ext-gwt and gwt-ext.
  • GWTcomponents, which appears abandoned, but might have useful components.
  • gwt-fx: not strictly a widget toolkit, but rather a way to do effects natively.

Here is a page with other libraries that I don’t have a lot of experience with, but might be worth investigating. And looking on google code turns up a large number of projects devoted to GWT extensions.

[tags]widgets, ajax toolkits[/tags]

Article on Building “Normal” Websites with GWT

Here’s an interesting article about building websites with GWT.  By ‘normal’ this author is talking about integrating GWT components into existing HTML pages, or making widgets available to non technical users.  This is in contrast to what seems like the sweet spot of GWT–building rich web applications.  (I’ve talked about these two use cases before.)  I was impressed by the author’s assessment of the GWT widget landscape and the machinations to create a vertical TabPanel and the follow up about internationalization.  I haven’t done any i18n with GWT, but the fact that you can’t change locale after load time certainly seems like a large flaw.

Setting headers in a PHP include directive

I am currently working on a project that uses a PHP CMS for the bulk of the site. However, it pulls some content from a page generated by JSTL on a tomcat. I was using the fmt tag to do some pretty printing of numbers, and it looked fine when I viewed the content as served by tomcat. However, none of the formatting was carrying through when the PHP page included the jsp. Why? It appears that the fmt tag needs a locale. I confirmed that with wget.

Now, how to set the header with the PHP include. The include man page was no help, and mod_rewrite won’t let you modify headers, as far as I can tell. Once the request arrived to tomcat, that was too late.

Some digging around in the PHP documentation on fopen turned up this gem:

Custom headers may be sent with an HTTP request prior to version 5 by taking advantage of a side-effect in the handling of the user_agent INI setting. Set user_agent to any valid string (such as the default PHP/version setting) followed by a carriage-return/line-feed pair and any additional headers. This method works in PHP 4 and all later versions.

Click through for a code example. The aforementioned documentation talks about custom headers, but it worked for sending the Accept-Language header that the fmt tags needed.

JSTL 1.2 and “Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found” exception

I am using JSTL for a project. For such a standard, it’s a bit wierd to get started with. Sun provides a spec, but as far as I can see, you have to download the entire J2EE stack to get the jarfile. There’s not a lot of good documentation on getting started with it (this page, though dated and focusing on JSTL 1.0 and 1.1, was helpful).

One exception in particular dogged me. If you are trying to get started using Tomcat (my version is 6.0) and JSTL, and are getting this exception when you are using the JSTL tags, run, don’t walk to your nearest Xerces download center and place xercesImpl.jar, in your lib directory (I also needed Xalan, for JSTL 1.2, which I had to download from here):



HTTP Status 500 -


type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception
javax.servlet.ServletException: javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:274)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.cohomefinder.eightz.servlet.RequestDispatcher.doGet(RequestDispatcher.java:30)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
org.apache.taglibs.standard.tlv.JstlBaseTLV.validate(JstlBaseTLV.java:161)
org.apache.taglibs.standard.tlv.JstlCoreTLV.validate(JstlCoreTLV.java:105)
org.apache.jasper.compiler.TagLibraryInfoImpl.validate(TagLibraryInfoImpl.java:761)
org.apache.jasper.compiler.Validator.validateXmlView(Validator.java:1774)
org.apache.jasper.compiler.Validator.validate(Validator.java:1743)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:178)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.cohomefinder.eightz.servlet.RequestDispatcher.doGet(RequestDispatcher.java:30)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.


Apache Tomcat/6.0.14

Advice for Attending Technical Conferences

I just got back from Google I/O.  This two day conference was the successor to Google Developer Day. There were a wide variety of topics covered.  I hope to get my notes written up, but for now, I just wanted to capture some advice on conference-going, mostly for my future reference.

  • Go to more conferences, at least one a year.  Sure, they take time and money away from real work, but they refresh you, expose you to new technologies and people, and recharge your batteries in a different manner than a typical vacation.  If you are not excited by the end of a technology conference, maybe you shouldn’t be in technology.
  • Realize that you probably won’t find a solution to a specific problem you have.  Why?  Because your problem is probably very specific to your current situation.  Talks at conferences tend to focus either on general introductory material, or very specific, in depth explanations of other people’s solutions to problems.  Chances are their problems weren’t yours.
  • That said, come with specific questions/areas of interest.  This lets you have focus when you are confronted with the vast feast of knowledge that most conferences display.  Make sure you read the schedule and note interesting talks.
  • Don’t eat all the snacks provided.  There’s a temptation to take advantage of all the ‘free’ food, but gorging yourself will make you sleepy.
  • Realize that you can’t see all the interesting sessions.  See if the conference is posting video later.  Google I/O is (supposedly by June 6).
  • Talk to people.  This is one of the hardest things for me to do–there are a ton of strangers at a conference, I’m not sure if they’ll have valuable information, and it’s so much easier to sit back and wait for someone else to talk to you.  But everyone I talked to at I/O had an interesting story to tell, and most everyone was interested in what I had to say.
  • Get people’s business cards.  It’s flattering to be asked for a card, and you never know when you might run across an article or project that might be of interest to someone you’ve met.
  • The informal meetings (Birds of a Feather, Fireside Chats) are worth far more than the organized talks.  There is a fantastic amount of formal and informal articles, blogs and videos about technology that you can consume at your leisure, in your bathrobe at home.  Far less common is interactive descriptions of problems and solutions, including face to face time.  While mailing lists and newsgroups take care of some of these needs, social time at conferences is an even easier way to have these kind of thought provoking and wide ranging discussions.  Also, it’s easier to talk to people when that is the purpose of the event.
  • Sit at the back of the session, and on the sides of the row of chairs. This lets you exit easily if you need to.  (Of course, not everyone can do this.)
  • Verify how feedback will be given to the speakers before you spend any of your precious time filling out feedback forms.  Conference organizers, this is a call for you to step up and tell attendees how their feedback will be delivered–I heard at least one speaker say that in ten years of attending conferences, he had never seen any feedback forms.
  • Keynotes are interesting, high level, and great places to finish breakfast.
  • Use a notepad, not a laptop.  For I/O, I took a laptop one day and a notepad the next.  I have a hard time taking notes on a laptop and not being distracted by email, searching for concepts/tools/projects that the speaker mentioned, and upcoming work.  (I’m not sure I’m NADD compatible.)  With a notepad, you can capture everything you feel is important, and if it is really important, you can revist it later.
  • Review your notes.  Perhaps for a blog post, but definitely review them and break out action items–projects to investigate, articles that you should read, information to pass on to colleagues.  Act on those action items.
  • Bring a water bottle.

[tags]io2008[/tags]

Google I/O

I’m off to San Francisco for Google I/O, a two day conference on focused on web application development, with a heavy focus on Google’s APIs and tools. I’m excited for sessions ranging from “Faster-Than-Possible Code: Deferred Binding with GWT” to “Underneath the Covers at Google: Current Systems and Future Directions”.

I probably won’t be live blogging the sessions, but I will try to write a wrap up post. If you’re attending, I hope to see you there.

Useful Tools: Password Safe

One of my clients has a fairly complicated web application. In any application of this nature, there are a lot of usernames and passwords–for DNS management, databases, accounts for integrated services, etc. Where can you store all these?

Well, you could have a master excel spreadsheet that gets version controlled. You could also go the route that some of my sysadmin friends have–a text file that is PGP encrypted. You could manage all the passwords via extensive sticky note or social memory (I might recommend against the latter two methods).  Or you could use a specialized password management software. I haven’t done extensive research on in this area, but so far we’ve been using Password Safe, and I’ve been relatively happy with it.

Good features:

  • You can open up the password file as ‘read only’, preventing you from mistakenly adding or changing data in the file.
  • There’s an option to generate passwords. So, if you’re having a hard time coming up with a secure password, the software can string together a random set of characters.
  • You can copy the password from Password Save and paste it into your application without even seeing it.
  • Once you give it the master password, it will only stay open for a certain number of minutes.
  • You can group password entries within the tool for better organization.
  • You can associate a URL with a password entry, and use keyboard shortcut to open that URL when you are viewing the password entry. This is something I thought was kind of useless until I started using it.
  • Password Safe supports windows and linux, and there’s other projects out there supporting more platforms, like Password Gorilla

The only issue I can think of is that version controlling the password file can be tedious. Just like version controlling any other binary file, CVS (or any other source management system) can’t do merges. That means that when you change something, you need to make sure that anyone who will change something else in the file updates before they do. The alternative is to not have it version controlled, but I like everything in version control.

If you have many passwords to manage, I’d recommend taking a look!

IE7 doesn’t like div classes named ‘content’

I ran into a really bizarre issue today.  A client’s website had paragraph tags separating content, wrapped inside a number of divs.  One of the divs had the classname of ‘content’.  In IE7, and not in FF2 or IE6, the first line of the paragraph was indented.  Modifying, even deleting, styles of the parent divs or the paragraph did not seem to change anything.  Adding a break tag as the first child of the paragraph tag fixed the indentation, but led to too much space.

Finally, I tried deleting the entire classnames from the parent divs.  Deleting the class ‘content’ from one of the divs fixed the issue.  Then I tried with a classname of ‘contaent’, and the issue was still fixed.

Apparently IE7 doesn’t like divs with the name ‘content’?  I was able to use ‘content-wrapper’ just fine.  Beats me.  A cursory search of the internet didn’t turn up any suggestions, and I unfortunately don’t have the time to try to plumb the depths of this bug.
[tags]IE weirdness[/tags]