Gaurav,
> If anybody is working on "cgi and servlet interaction", kindly help!
>
> We have an application which handles all the cgi requests via tcl
> (tickle). I have a tcl script which does certain database information
> retrieveal on the basis of the user input. I want this script to invoke
> a servlet and pass this information to it, so that the servlet can then
> create graphs on the fly based on this information (using gifencoder
> class from ACME) and send this graph to the client browser.
You're asking almost the right question. Your TCL script can't
send graphics directly to the browser (unless all it's doing is
returning a single graphic image). Usually the CGI script reutrns
HTML. You can have the HTML include IMG tags that invoke the servlet
with GET style query arguments. What you do is have the TCL script
generate an HTML page with image tags that look like:
<IMG
SRC="http://yoursite.com/servlet/yourservlet?argument=blah&otherargument=moreblah">
Then have your servlet take the arguments, do whatever munging
you need, and either return a redirect (A "Location:" directive or
using the servlet redirect() method) or return the binary image data.
If your CGI script is returning a single image, you could have
the TCL script directly invoke the servlet as an HTTP client, take the
graphic the servlet returns, and pass it back to the browser. But
you'd have to figure out how to get TCL to pretend to be an HTTP
client, and it'd probably not be worth the grief. You could also have
the TCL script invoke the servlet, have the servlet generate the image
with a temporary name, and pass the image name back to the TCL script,
and from thence to the browser. Again, probably not worth the grief.
Steven J. Owens
[EMAIL PROTECTED]
[EMAIL PROTECTED]
___________________________________________________________________________
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