Categories
General

Nokia N95-8GB: First odd tidbit

I recently purchased a Nokia N95-8GB (aka Nokia N95-4) because I wanted a phone capable of taking really good photos that I could easily share over a 3G network. It achieves these tasks with aplomb. Still, the more I use the phone the more I feel, like I did when I tried out the Nokia E71, that the mindblowing hardware is being sold way short by the cludgy OS, Symbian S60 v.3. It is slow, its multi-tasking is mediocre and the user interface is just outdated. I often wonder is anyone tested the phone in a usability lab.

I plan to share on this blog moments from my life with this otherwise amazing device. I should have read the manual. I intend to. I am a busy guy so sometimes I will clearly should have RTFM.

Today’s tidbit – downloadable videos: I stumbled across the video service download capability of the phone in its Video Center application. You can tell the phone which services you want to get updates on available

e content from – using a special website the phone connects to. Once selected, the phone fetches recent videos available, probably from an RSS feed. The video downloads very quickly – a 1 minute long video downloads in about 1.5 minutes. The quality is great.

Once you’re done watching, though, and we’re talking about a device with 8GB of memory but no way to expand on that memory, there is NO way to delete the video you have just viewed. There is also no information about whether that video will be deleted automatically. If you read the help file, that is easily accessible, it tell you that the video is saved to another section of the video center, ‘My Videos’. It’s a relief to know that. But why? Why can I not just delete the video right there from the list of videos in which it appears? Does not make sense.

Share
Categories
General

Jetty 6 welcome file: how to use a servlet to handle your welcome file

I ‘ported’ my Java web application from Tomcat to Jetty. Like any web application, I defined a ‘welcome file’ in the application’s web.xml file. The welcome-file directive specifies the URL to be loaded by default when someone requests the root of your application. The welcome file may be just a file or a JSP, e.g. index.html, or it may be a name that is mapped to a servlet’s url (through the element in web.xml).

In Tomcat, specifying something like

Code listing of web.xml file

will work just as you would expect. But in Jetty, it will not. Unless you provide a workaround. What the somewhat angrily written post says is this: If you map a servlet to the URL index.htm, a file called index.htm must still exist. You *must* have a static, even empty, file called index.htm to have Jetty pass the request to your servlet that is mapped to that URL. Sorta cludgy, glad I found the answer quickly. Hope this helps others.

Share
Categories
General

Adding Jetty 6 to Eclipse as a server runtime and overcoming the NullPointerException on Launch

I love Jetty. It is small, it is very fast and once you use it you start pondering why you use Tomcat. The reason in most cases is that you know Tomcat and it is relatively very well documented. Jetty is not as well documented but well worth the effort. One thing that Tomcat has and Jetty does not is built-in support in Eclipse as a server runtime.

The beauty of server runtimes is that you can easily deploy and update-on-the-fly web applications to the server. So if you modify a class in an web application, it is automatically updated – possibly restarting the server for you.

The makers of Jetty try to fill in this gap with their server runtime – which can be easily installed if you follow the instructions. Still, when trying to launch my web application on the new Jetty runtime, I kept getting an obnoxious, trace-free NullPointerException. As a user of Eclipse 3.3.2 Europa with little time to upgrade to Ganymede, I repeatedly tried to upgrade the WTP from my version 2.0.2 to whatever is current. That fails, in classic Eclipse fashion, because it is all geared at the *current* version of Eclipse (3.4).

What ended up working for me was to download the 2.0.2 patches from the WTP site. I extracted the files from the zip file to a directory. I then installed them using the update manager as a local site. To do that:

  1. Open the update manager: Help -> Software Updates -> Find and Install
  2. Choose ‘Search for new features to install’ and click ‘Next’
  3. Click ‘New Local Site’
  4. In the window that will open, point at the location that you extracted the zip file to, and in there, the ‘eclipse’ folder
  5. Click Finish

Eclipse will automatically install the patches, potentially restarting itself to have them take effect. This should cure the NullPointerException on launch for Jetty, and actually for several other servers that suffered from it in version 2.0.2 of the WTP in Eclipse 3.3.

NOTE:
If this does not work, also make sure that Eclipse is using the JDK’s JRE and NOT a generic Java JRE. A servlet container like Jetty must be able to compile files on the fly and therefore needs the JDK beyond the JRE.

Share
Share