thank you all for suggestions and help!

special thanks to jeff, Http(s)Message works fine for
me and solves my problem.

basti




Jeff Kilbride wrote:

> Check out the HttpMessage and HttpsMessage classes in the
> com.oreilly.servlet package available from Jason Hunter at www.servlets.com.
>
> Does the same basic connection stuff and returns an InputStream which you
> can wrap in a BufferedReader like Eric does below. The nice thing is that it
> does secure ssl (https) connections also with the JSSE jar files -- and it's
> very easy to setup and use.
>
> Thanks,
> --jeff
>
> ----- Original Message -----
> From: "Eric Lubin" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, May 18, 2001 8:58 AM
> Subject: Re: RequestDispatcher.forward()
>
> > package com.ibm.servconn;
> > import java.net.*;
> > import java.io.*;
> > import java.util.*;
> > import com.ibm.aurora.*;
> >
> > public class URLForward {
> >
> >    private String theURL;
> >    private String method;
> >
> >    public URLForward( String theURL ) {
> >       this(theURL,"POST");
> >    }
> >    public URLForward( String theURL, String method ) {
> >       this.theURL = theURL;
> >       this.method = method;
> >    }
> >
> >    public String[] execute() throws BehaviorException {
> >       Vector v = new Vector();
> >       try {
> >          URL theServlet = new URL(theURL);
> >           // establish a connection with the server, but do not connect to
> > the servlet yet
> >          HttpURLConnection theConnection
> > = (HttpURLConnection)theServlet.openConnection();
> >          theConnection.setRequestMethod(method);
> >           // now we can connect to the page
> >          theConnection.connect();
> >           // read the results from the servlet as a String
> >          BufferedReader in = new BufferedReader(new
> > InputStreamReader(theConnection.getInputStream()));
> >          String inputLine;
> >          while ((inputLine = in.readLine()) != null) {
> >             v.addElement(inputLine);
> >          }
> >          in.close();
> >          String da[] = new String[v.size()];
> >          v.copyInto(da);
> >          return da;
> >       }
> >        // have to handle these somehow
> >       catch( MalformedURLException mue ) {
> >          throw new BehaviorException("Malformed URL
> > address",ServConnBhvrErrors.MALFORMED_URL,mue);
> >       }
> >       catch( IOException ioe ) {
> >          throw new BehaviorException("IOException - the translator might
> be
> > down",ServConnBhvrErrors.CANT_CONNECT_TO_SERVER,ioe);
> >       }
> >    }
> > }
> >
> > Eric Lubin
> > T/L 443-6954  External:  561-443-6954
> > Notes ID:  elubin@ibmusm20    External: [EMAIL PROTECTED]
> >
> >
> > Sebastian Schulz <[EMAIL PROTECTED]> on 05/18/2001
> > 10:58:33 AM
> >
> > Please respond to [EMAIL PROTECTED]
> >
> > To:   [EMAIL PROTECTED]
> > cc:
> > Subject:  RequestDispatcher.forward()
> >
> >
> >
> > hi,
> >
> > has somebody a work-around to produce the
> > same behavior as if RequestDispatcher.forward()
> > would work with absolute URL's?
> >
> > tanks in advance!
> >
> > basti
> >
> >
> >

Reply via email to