Is there a way to convert instances of type inputstream , outputstream to ServletRequest and ServletResponse types ?
Posted on 2007-03-21
Actually I have objects of type inputstream, outputstream as shown in code below:
OutputStream raw = new BufferedOutputStream(connection.getOutputStream( ));
Writer out = new OutputStreamWriter(raw);
Reader in = new InputStreamReader(new BufferedInputStream(connection.getInputStream( )),"ASCII");
Now I want to convert these to ServletRequest and ServletResponse types so as to pass it to a dynamically invoked servlet class like:
servlet1 = (Servlet) myServletClass.newInstance();
However I am not sure how I do such conversion ? A simple typecast to ServletRequest and ServletResponse doesn't works.
Any suggestions .