Yparxoyn duo kuria problhmata sto trejimo enos programmatos Java apo enan diakomisth istou:
Xreiazetai na trejete ton diermhnea Java run-time kai na parexete thn arxikh klash (programma gia na trejete) sth grammh entolwn. Me mia forma HTML, den yparxei kamia frontida gia na stelnete mia grammh entolwn ston diakomisth istou.
Ka8e metablhth periballontos poy 8a xreiastei apo to programma Java
prepei na perastei me safhneia.
Den yparxei kamia me8odos paromoia me th leitoyrgia ths C, getenv()
.
Gia na antimetwpisete ayta ta empodia, egraca ena CGI programma kelufoys poy parexei tis plhrofories poy xreiazontai apo ton Java diermhnea.
Ayto to senario kelufoys diaxeirizetai thn allhlepidrash metaju toy HTTP daimona kai toy programmatos Java CGI poy epi8ymeite na xrhsimopoihsete. Ejagei to onoma toy programmatos poy 8elete na trejete apo ta dedomena poy parexontai apo to diakomisth. Syllegei ola ta dedomena periballontos se ena proswrino arxeio. Ustera, trexei ton Java run-time diermhnea me to onoma toy arxeioy apo tis plhrofories periballontos kai to onoma toy programmatos poy proste8hke sth grammh-entolwn.
To java.cgi
script diamorfw8hke kai egkatasta8hke sto
Apofasiste gia tis politikes topikwn diadromwn sas.
Oi formes moy poy xrhsimopoioun programmata Java CGI ka8orizoyn mia energeia formas opws akolou8ws:
<form action="/cgi-bin/java.cgi/CGI_Test" method="POST">Opoy
/cgi-bin/
einai o topikos sas CGI binary katalogos,
java.cgi
einai to Java front-end poy mas epitrepei na trexoyme programmata Java ston isto kai to CGI_Test
einai ena paradeigma onomatos programmatos Java gia na trejete.