What’s happening? Consider the following XPage:
You would expect this XPage to output
abca, but it doesn’t. It will output
abc and at the same time show the following error on the Domino server’s console:
a to something with two characters fixed the error and gave the expected output. But feeding it the number
0 (which was my original problem) did not.
12 on the other hand was fine.
If course, this had to be a bug, so I send a nice little report to Paul Hannan. Unfortunately it’s not (so much for street credibility points), and Martin Donnelly explains why:
The com.sun.faces.renderkit.html_basic.HtmlResponseWriter class has overloaded write() methods - like this:
void write(char, int, int)
void write(String, int, int)
writer.write("g");the engine does not know whether to call void write(char) or void write(String) on the Java side.
To pass in a single character to the writer class that you either: a) find a non-ambiguous version of a write method and force that to be called, b) declare the var as an explicit Java type and pass that in
Both are shown here:
var writer = facesContext.getResponseWriter();
// This will work …
// So will this …
var r = new java.lang.Character(‘r’);
This problem can happen easily when you’re creating an XAgent. Be careful what you feed the
writer.write(). If you’re not, you might get some hard to debug errors.