Saturday, December 30, 2006

New Redhat/Fedora/RHEL/CentOS build

My ToDo list for new Redhat-derivative builds:
  • start with minimal package and add
  • change font in /etc/sysconfig/i18n to lat0-08
  • append vga=1 phrase to /boot/grub/grub.conf kernel line
  • remove irda, isdn, pcmcia and similar packages
  • enable yum nightly
  • change httpd, sshd to use non-standard ports (update /etc/sysconfig/iptables accordingly)
  • harden sshd (e.g., no root login, protocol 2, strict modes)
  • revisit chkconfig to make sure services are started (or not) on reboots

Burning DVD ISO in Linux

growisofs -Z /dev/dvd=ISOFILENAME -speed=2
Where ISOFILENAME is CentOS-4.4-i386-binDVD.iso, for instance. Note:
  • -Z closes the DVD from additional sessions (which is the normal case when burning .ISO files).
  • For some reason, under FC4, you can't sudo the command, you must be root.

Thursday, December 14, 2006

Handling non-GWT POSTs in GWT servlets

Posted and answered my own question regarding Google Web Toolkit. The way to handle non-GWT POSTs in GWT servlet is to:
  • Override the service(...) method. If your servlet inherits from GWT's RemoteServiceServlet, you can't override doPost as RemoteServiceServlet has marked it final.
  • Figure out some way to distinguish a GWT POST from a non-GWT POST. The easiest way is to add a hidden field (i.e., ) and check for that parameter value in the service(...) method. If that parameter isn't there, then call super.service(...) so that GWT calls can go through.
  • Declared the servlet in MODULE.gwt.xml like any other servlet (GWT or not).

Since I use Instantiation's GWT Designer, it automatically generates the service's Async interface java file, implementation java file, and servlet entry in the MODULE.gwt.xml file. Thus all I do is add the service(...) method in the implementation file.

Cheers.
boscomonkey wrote:
> In our GWT app, we have a login dialog box that pops up to handle fresh
> users or users whose sessions have timed out. Now we wish to accept
> username/password POSTs from our static web site or even affiliate web
> sites. What are some approaches for handling POSTs from outside the GWT
> app?
> It seems that one simple approach is to write a standard servlet that
> implements doPost, place it in our GWT app's server package space, and
> if users authenticate properly, redirect to our GWT app's URL. In this
> case, do I have to map this servlet in our MODULE.gwt.xml? What's the
> URL to this servlet?