Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet from servlet

 
Vlad Patryshev
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Erick Jones
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic