Code Camp Tips and Tricks

I just posted some screen shots from the tutorial day to Flickr:

http://www.flickr.com/photos/32840315@N04/sets/72157610279717309/

I’m posting some other tips and suggestions here later.

If you have trouble to deploy the applications in Tomcat from Eclipse. I’d give you the following generic sanity check guidelines:

  • Check WebContent/web.xml. Use “/*” mapping for the servlet to avoid any further configuration. The URL above should work.
  • If got a blank page, you need probably to add the “/ITMILL/*” mapping to web.xml

I did give instructions to use some other servlet mapping in web.xml (like “/myapp/" and if you are using this method the context "/ITMILL/” should be mapped to the same servlet. If you use this method the full application URL is something like: http://localhost:8080///

Here the most simple web.xml configuration for a new IT Mill Toolkit project:


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns="http://java.sun.com/xml/ns/javaee" 
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" 
version="2.5">
  
  <servlet>
  	<servlet-name>MyApp</servlet-name>
    <servlet-class>com.itmill.toolkit.terminal.gwt.server.ApplicationServlet</servlet-class>
    <init-param>
      <param-name>application</param-name>
      <param-value>mypackage.MyApplication</param-value>
    </init-param>
  </servlet>
  
    <servlet-mapping>
    <servlet-name>MyApp</servlet-name>
    <url-pattern>/*</url-pattern>
  </servlet-mapping>
  
</web-app>

I saw that some of you were using the “trunk” version instead of 5.2.12. If so, there is a new release available to per today:


http://itmill.com/download/testing/trunk/itmill-toolkit-5.3.0_trunk_200811281040.jar

Because is the cutting-edge of development it may it is worthwhile to upgrade. Note that the GWT WidgetSets may need recompilation.

Hello,

Thanks for posting the current build. I was having real problem with the previous trunk I was using. After I integrated my little map widget with the application I built, the select dropdown list was throwing wired JSNI exceptions whenever I clicked on that, now with the new trunk its gone…:slight_smile:

RC1 of 5.3 is out too, but it should be almost the same as 28.11 trunk version Sami posted, as they came out on the same day.

you can grab the release candidate from http://www.itmill.com/download/itmill-toolkit/unstable/5.3.0/rc1/

Many are looking the infamous JavaScript alert(“something”) command. There is no default way of invoking the native browser alert dialog, but there is a much nicer way: Notifications.

Take a look at the Window class. There are functions like showNotification(String) and showNotification(String, int).

Example:


getWindow().showNotification("This is the application speaking");
getWindow().showNotification("This is an errror",Notification.TYPE_ERROR_MESSAGE);

Window Javadoc:

http://toolkit.itmill.com/demo/doc/api/com/itmill/toolkit/ui/Window.html#showNotification(java.lang.String)

Notification Javadoc is here:

http://toolkit.itmill.com/demo/doc/api/com/itmill/toolkit/ui/Window.Notification.html

Some liked to use Apache Derby as embedded database. I was not familiar with this database, but it seems to be a very good alternative to HSQLDB which comes bundled with our examples package.

So, if you need an embedded database, take a look these:

To see how to use HSQLDB with the Hibernate see:

http://dev.itmill.com/wiki/Articles/UsingHibernateWithToolkit

Sun has also it’s own distribution of the Apache Derby called Java DB. It even seems to be bundled with the JDK 6.

http://developers.sun.com/javadb/

Hey,

Happy new year to all…
I went to Turku during Xmas and what a luck!! ITMill office was just beside the apartment building I stayed in during my stay at Turku :slight_smile: Near Kupittaa station. Were it not a vacation time, I may have gone to visit the office as well :slight_smile:

//sumanta
TKK