aspose file tools*
The moose likes Servlets and the fly likes servlet from servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet from servlet" Watch "servlet from servlet" New topic
Author

servlet from servlet

Vlad Patryshev
Ranch Hand

Joined: Jun 30, 2001
Posts: 61
I am having trouble trying to do the following:
From one servlet I want to get the contents returned by another servlet (that is, using its url, get connection and retrieve the content) - and all on the same server. It seems like it does not work. I used Tomcat 3.3 and 4.0. Any ideas? Any hints?


Thanks,<br />Vlad
Erick Jones
Ranch Hand

Joined: Jun 17, 2002
Posts: 38
What code did you try? This should work:
URL url = new URL("/relative-path/DataServlet");
From the url object you can get an input stream.
Erick Jones
Ranch Hand

Joined: Jun 17, 2002
Posts: 38
What code did you try? This should work:
URL url = new URL("/relative-path/DataServlet");
From the url object you can get an input stream.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: servlet from servlet