Redirect output of a servlet called from a Java agent

I run a servlet from a Java agent andI want to redirect its output to the browser, not to the Domino console.

Any idea?

Thanks.

Here’s the agent code.

[…]

URL mDocServletURL=new URL(servletURL);

URLConnection mURLconnection = mDocServletURL.openConnection();

mURLconnection.setUseCaches( false );

mURLconnection.setDoInput( true );

mURLconnection.setDoOutput( true );

mURLconnection.connect();

BufferedReader in = new BufferedReader( new InputStreamReader( mURLconnection.getInputStream()));

String inputLine;

while ((inputLine = in.readLine()) != null)

System.out.println(inputLine);

in.close();

mURLconnection = null;

[…]

Subject: Redirect output of a servlet called from a Java agent

Sophia,

I don’t expect you to see this post since I am responding almost a year later, but I’ll answer your question for the benefit of anyone who might come across this in a search.

I believe the following example will work (I haven’t tried it):

PrintWriter pw = null;

pw.println(“”);

Ken