-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------

Tifara Markovits <[EMAIL PROTECTED]> writes:

> thanks for your response, Paul, i really appreciate your help.
> there are two points i need clarifying on if possible. 1: i am a
> newbie, is there anywhere i can find examples of how FileInputStream
> is used?  i can't find any material on it. and 2: how do i get the
> url of the original requested page?  this is what i have been trying
> to do and i can't figure it out (it's got me baffled).

I recommend the O'Reilly Servlet Programming book for some good
examples, but here is some code to get you started:

  String uri = request.getRequestURI();
  File fileRequested = new File("/usr/local/apache/htdocs" + uri);
    
  BufferedReader input = new BufferedReader( new FileReader( fileRequested ) );

  PrintWriter output = response.getWriter();
    
  while (input.ready()) 
  {
    output.println( input.readLine() );
  }

  output.flush();

-Paul


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to