There is also an issue with your code.
The session attribute is set from the methd: "writeDocumentToOutput" .
This method is called recursively.
Every time you call the method it is setting the session attributes, and overrides the previous value it had.
That explains why you only get the "last" value.
This class looks like it was written for an app, and is being adapted for the web.
What is it you are trying to accomplish in the display?
Sometimes you feel like a nut. Sometimes you feel like a tiny ad.
a bit of art, as a gift, that will fit in a stocking