Link to home
Start Free TrialLog in
Avatar of ariefishler
ariefishler

asked on

Inserting CGI's output into an HTML page

I have an HTML page containing a reference to a CGI/Servlet. I would like the CGI/Servlet to be activated while loading the HTML and its output added (inserted) into the page at the place where the CGI/Servlet reference is. This output of the CGI is another HTML text which must be parsed by the browser. I think that the ILAYER tag is doing what I want but the ILAYER is not standard and not supported by MS IE.
Avatar of jrsjr
jrsjr

Could you have the CGI servlet do its processing and then output the entire page at the end of execution?  That way you could insert the text you wanted to insert.
SSI (Server Side Includes):
<!-- #exec cgi="..." -->

I don't know if this will work with servlets tho.
Also, it's possible that you'll have to rename the file to *.stm / *.stml

Martin
Martin, the extension for HTML processed at the server is .shtml, isn't it?

I don't know about ILAYER but MSIE (>=4.0?) understands <IFRAME FRAMEBORDER="NO" SCROLLING="NO" SRC="/cgi-bin/theCGI.cgi">Code for non-IE browsers</IFRAME>

The most straightforward solution is that of jrsjr. If you don't want to recode the CGI, just split the .html and make a shell script:

cat header.html
/cgi-bin/theCGI.cgi <pass the parameters>
cat footer.html

but if the CGI generates a full HTML file with <HTML><BODY>...</BODY></HTML>, this won't work.
Avatar of ariefishler

ASKER

Maybe there is something I am missing but I can't see how jrsjr's solutions solves the problem. The whole process must be initiated by calling for a URL to an html page. In that html there must be a sort of TAG (the answer I am looking for) which activates a Servlet(CGI). The Servlet's result will be html which will be processed by the browser. This is exactly what ILAYER does !
Then it is either ILAYER or IFRAME.
DavidME.....I will accept it..:) Just send it as an answer  
ASKER CERTIFIED SOLUTION
Avatar of DavidME
DavidME

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial