I am trying to invoke another servlet from my main controller servlet and get it's output for further processing but I can't figure out how to do it. I tried reading from the inputstream after calling the include method but that didn't work. Any suggestions are appreciated.
Thanks
Eric
-
How do I get the output of an included servlet (2 messages)
- Posted by: eric vice
- Posted on: September 06 2000 19:22 EDT
Threaded Messages (2)
- How do I get the output of an included servlet by Alex Fu on September 06 2000 22:52 EDT
- How do I get the output of an included servlet by eric vice on September 08 2000 14:25 EDT
-
How do I get the output of an included servlet[ Go to top ]
- Posted by: Alex Fu
- Posted on: September 06 2000 22:52 EDT
- in response to eric vice
try following:
String line="",str,url,host;
url=request.getParameter("url");
host=request.getServerName();
url="http://"+host + url;
if (url!=null){
URL u = new URL(url );
DataInputStream server = new DataInputStream(u.openStream());
while((str= server.readLine()) != null){
line+=str;
}
}
help it is useful to you.
-
How do I get the output of an included servlet[ Go to top ]
- Posted by: eric vice
- Posted on: September 08 2000 14:25 EDT
- in response to Alex Fu
Thanks much. that example does help.