« Back to home

XPages reliability checklist

When XPages works, it’s great. When it doesn’t work, it’s a pain. Partial refreshes suddenly stop working, user data is thrown away, and forms become unsubmittable. The root problem is that JSF holds a complex tree of objects on the server, representing the state of all the components on the web page — along with a Domino document for your data, and all the scope variables. Each HTTP request to the back end is accompanied by a $$viewid value fetched from a hidden field on the Web form.…

Read more »

Better string lists in XPages

Like Notes, XPages supports multi-valued fields. You can set a separator for multiple values, and tell XPages whether to trim whitespace from around each value. Unfortunately, if you have (say) a list of string values, the separator ends up with no whitespace after it. This can look ugly: Mon,Tue,Wed Ideally we’d like to display the multiple values with a space after each comma, and also accept separators like newline or semicolon when entering data.…

Read more »

Implementing live search on a web form using XPages

Given that people find it hard to select from more than around 8 options, the “drop-down selector with live search filter” design pattern is useful for all sorts of situations. If you have a reasonably small number of options, you can do it all client-side. A couple of thousand select items can be read as JSON and filtered client-side without too much of a performance hit — at least, on the desktop, with a reasonably fast Internet connection.…

Read more »

SLF4J and XPages Java debugging

I like to write code once and be able to run it both in the Domino XPages environment, and in regular Java environments. That means I don’t want to use any Domino-specific logging. I also like the SLF4J interface, at least on the Java source code side of things. In particular, I like how easy it is to log values using parameterized logging: // Painful JDK logging Logger logger = Logger.…

Read more »

Playing Domino without a POODLE

If you run any kind of Internet server, you’ve hopefully heard about the POODLE vulnerability in SSL 3. If you run a Domino server, you need to worry about this, because Firefox plan to turn off SSLv3 support in their next release in a couple of weeks and remove the code in the release after that — and Chrome will follow soon after. SSLv3 is the only secure connection supported in Domino out of the box, so that could leave you with no HTTPS support.…

Read more »

User friendly edit buttons with XPages

I wrote my first full application using XPages, the new IBM Domino web development environment based on Java Server Faces (JSF). It’s been quite a brutal learning curve, even given that I already knew both Java and JavaScript in some depth. Some things that are trivial ‘the old way’ (in Notes) are harder on the web with XPages. For example, when you try to edit a document and don’t have permission, the Notes client will give you an error message.…

Read more »

JDK 8 JavaScript scripting experiment, with added Domino

Oracle’s new JDK 8.0 includes a new JavaScript engine called Nashorn, designed to support both embedded JavaScript in Java applications, and standalone command-line JavaScript. As well as accessing JavaScript from Java code, you can do the reverse, and access Java classes from JavaScript — just like in IBM Domino XPages. The new scripting features are now a standard part of the JRE. For now, the command to actually run a script is described by Oracle as “experimental and unsupported”, but I wasn’t going to let that put me off; I immediately wondered how easy it would be to write a command-line script which accessed Domino data, using only JavaScript.…

Read more »

Attack of the Heisenbug

This week I battled a bug which was exceptionally sneaky at hiding itself. Consider the following Domino Java code accessing a single-valued date-only field: Document doc; […fetch document…] Vector v = doc.getItemValueDateTimeArray("SomeDateField"); DateTime dt = (DateTime) v.get(0); Date jdt = dt.toJavaDate(); System.out.println(dt.toString() + " = " + jdt.toString()); What happens when you run the code? Well, the getItemValueDateTimeArray() call fetches the contents of the Notes item (field) from the document, and returns it as a Vector of Notes DateTime objects.…

Read more »

Tracking down misbehaving Domino web agents

The problem: You have a web agent somewhere which uses LotusScript MessageBox to output an error message. However, the message doesn’t say which agent or database it’s being output by, so you need to locate the agent which is printing the text. The solution: At the console, set config AgentThreadDebug=1 tell http restart The HTTP task will then display a debug message for each web-triggered agent that starts or ends.…

Read more »

Cookies with XPages

My first XPages app is coming along nicely. Today I needed to add some cookie support, and discovered that the otherwise comprehensive Mastering XPages had no information on the topic. There’s a post on the Lotus Developer Domain, but it’s a bit vague and makes the whole thing look harder than it really needs to be. I started by writing myself a quick Server Side JavaScript library to encapsulate the details.…

Read more »