[EMAIL PROTECTED] wrote:
> I would like to build a servlet that will only "tunnel" certain request to a cgi
>application on a seperate machine. (Not a http redirect, I need to have everything
>pass through this server)
>
> I guess I should be using request dispatcher, but I can not see it in jsdk.jar that
>is in websphere 2.02 Std. edition.
>
Request dispatchers were introduced in version 2.1 of the servlet API. If Websphere
supports that, you should be able to call:
getServletContext().getRequestDispatcher("/pathname");
to get a request dispatcher instance. Whether you can get a request dispatcher for a
CGI script on a different server is dependent on the engine you are using ... request
dispatchers are
designed to access other servlets in the same servlet context.
>
> are there somethings that I am missing? Do I need to code a request dispatcher
>myself? is there anything we can buy?
>
A way to tunnel to a CGI script (or even a static web page, for that matter) that
works on any servlet engine, or in any other Java application or applet, is to use a
URLConnection.
Essentially, you become the client of the CGI script's server, making an HTTP request
to it, and then processing the results that the script sends back as you see fit.
There's good examples
of using this class in the Java Language Tutorial:
http://java.sun.com/docs/books/tutorial
> Calvin.
>
Craig McClanahan
>
> --== Sent via Deja.com http://www.deja.com/ ==--
> Share what you know. Learn what you don't.
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html