Friday, September 21, 2012

How to print any data in XPage output

I was looking for a solution for output clean data in xPage without any tags.

Nice solution is present in the first comment to this post. In the case you need few xPage with output special data, better to create special base class and then just extend it.

More under cut.


It's our xPage source:



And our special Class:



All you need is special "tricky" base class:

2 comments:

NotesSensei said...

Actually you make your life easier when your class takes in an output stream as parameter for rendering. This allows you to test the class outside your XPage, so debugging is easier by feeding an FileOutputStream. You could have some convenience classes like:
public void render(OutputStream out) { ... }
public void render() {
this.render(this.getXPagesOutputStream());
}

Andriy Kuba said...

Could be a good idea