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.
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.
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. exceptionjavax.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 causejavax.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.
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.
Technorati Tags: io2008