Domino 9 und frühere Versionen > Administration & Userprobleme

Ausgabe Java Agent fehlt (manchmal)

(1/1)

gpeters:
Wir haben hier eine Datenbank, deren Java Agent via http angestoßen wird und dann das xml-Ergebnis wieder an den http-Browser schickt. Soweit jedenfalls in der Theorie. Seit der Migration von R4 nach R5 (!) wird - wenn die Antwort eine gewisse Größe (5kb) überschreitet - anscheinend die Antwort verschluckt.

Ich habe keine Ahnung wonach ich eigentlich suche. Daher hier ein kleiner Ausschnitt vom Agenten...

Danke für Eure Mühe.
Gerald


--- Zitat ---
Agent von mir wieder gelöscht, da in der Lösung entsprechender Programm-Code steht
--- Ende Zitat ---

gpeters:
Joo,
das Problem wurde doch schon mal im Notes.net gelöst:

--- Zitat ---
Java Agent Output to Web includes line returns
Posted by Zach Mabe on 4.Dec.01 at 11:10 AM using a Web browser
Category: Domino Designer -- AgentsRelease: All ReleasesPlatform: Windows 2000

I seem to have discovered that when an agent which is producing html to be sent back to the browser automatically inserts a line return every ~16k characters. The output is transformed XML and can size up to about 200K.

Well I was just fiddling with it a bit more in case the solution was obvious and I was just missing it and I found a solution. Kind of cludgy, but here's what I did.

Peeviously I attempted writing the entire contents as one string to the output. Didn't work.
Tried writing to output in char[1024] blocks. Didn't work.

Then I did this
BufferedReader sr = new BufferedReader(new StringReader(sw.getBuffer().toString()));
String input;
while ((input = sr.readLine()) != null) {
acout.println(input);
}

sw is a stringwriter holding the html.
acout is the agent output.

This works.

Seems like the long way around but did get rid of line returns where I didn't want them.

I hope this helps the next guy.

Thanks
Zach Mabe


--- Ende Zitat ---


Vielen Dank allen, die es wenigstens mal gelesen haben.

Gerald

Navigation

[0] Themen-Index

Zur normalen Ansicht wechseln