Question

Integrate cgi with java

Asked by: presynct

Hi,
I have a requirement where I have to execute the cgi program through java. I was given a URL for the cgi program, which is written to query the person names from the db. when I run that URL, with the argument of lastname, I will get the html page with the list of names which matches to that lastname. when I click on one of the name, I will get another html page with the detailed information of that specific person. So now my requirement is to gather that list of names, and/or specific person information from that html page and use it in our java application. First of all I dont have any idea, how to call that cgi url using the java. So could anybody help me on how to run the url and how to parse the html page to get the results into the java based application? Any help would be appreciated. I am posting the sample html source, which contains the detailed person information.
Thanks,
Presynct.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 
<!-- FORMS TOP.INS.HTML - Standard style sheet and top level nav bar -->
<!-- $Id: TOP.INS.HTML,v 1.6 2007/04/28 08:06:53 rcorbett Exp $ -->
 
<head>
<script type="text/javascript" src="/js/general.js"></script>
<script type="text/javascript" src="/js/cad.js"></script>
<script type="text/javascript" src="/js/layerFunctions.js"></script>
<script type="text/javascript" src="/js/layerMenu.js"></script>
<script type="text/javascript" src="/js/scrollFunctions.js"></script>
<script type="text/javascript" src="/js/hsi_csslib.js"></script>
<script type="text/javascript" src="/js/hsi_menulib.js"></script>
<script type="text/javascript" src="/js/hsi_xmlhttp.js"></script>
<script type="text/javascript" src="/js/customer.js"></script>
 
<meta name="Author" CONTENT="Hitech Systems Inc." />
<meta name="Description" CONTENT="SafetyNet Public Safety Website" />
<meta http-equiv="refresh" content="" />
 
<title>RMS - Hitech Systems SafetyNet Police Records System Web</title>
 
<link rel="SHORTCUT ICON" href="/images/favicon.gif" />
<link rel="stylesheet" type="text/css" href="/css/HSI-STYLE1.CSS" />
<link rel="stylesheet" type="text/css" href="/css/hsi_menulib.css" />
<link rel="stylesheet" type="text/css" href="/css/customer.css" />
 
</head>
 
<body class=body1 link="blue" vlink="purple" alink="blue" onload="init()">
 
<!-- Here's the table for the navigation and top graphic -->
 
<table border="0" cellspacing="0" cellpadding="0">
 
<tr class=topmsg>
   <td height=52 rowspan=3 colspan=2><a href="/index.html"><img
      src="/images/NavBarMainGraphic.gif" width="202" alt="Home"
      height="52" name="button" border="0" /></a></td>
	<td height=30 colspan=4 style='text-align:right' class=topmsg>
      <a href='#' onclick='openChgpwd()'>Change Password</a></td>
   <td style='text-align:right' class=topmsg>
      <a href='?WEB.LOGOUT'>Logoff</a></td>
</tr>
 
<tr valign="bottom">
 	<td><a href="?CADHOME.HTML" onmouseover="buttonOn('imgCAD');return true;"
      onmouseout="buttonOff('imgCAD');return true;"><img alt='CAD Home'
      src="/images/nav_cad_off.gif" width="118" height="12" name="imgCAD"
      border="0" /></a></td>
	<td><a href="?RMSHOME.HTML" onmouseover="buttonOn('imgRMS');return true;"
      onmouseout="buttonOff('imgRMS');return true;"><img alt='RMS Home'
      src="/images/nav_rms_off.gif" width="88" height="12" name="imgRMS"
      border="0" /></a></td>
<!-- 	<td><a href="?NCICHOME.HTML" onmouseover="buttonOn('imgNCIC');return true;"
      onmouseout="buttonOff('imgNCIC');return true;"><img alt='NCIC Home'
      src="/images/nav_smarts_off.gif" width="88" height="12" name="imgNCIC"
      border="0" /></a></td>
-->	<td><a href="http://172.31.28.153/" target=snare
      onmouseover="buttonOn('imgFMS');return true;"
      onmouseout="buttonOff('imgFMS');return true;"><img alt='SNARE Home'
      src="/images/nav_snare_off.gif" width="88" height="12" name="imgFMS"
      border="0" /></a></td>
 	<td><a href="?LINKS.HTML" onmouseover="buttonOn('imgLinks');return true;"
      onmouseout="buttonOff('imgLinks');return true;"><img alt='Links'
      src="/images/nav_links_off.gif" width="88" height="12" name="imgLinks"
      border="0" /></a></td>
	<td colspan=2><img src="/images/nav_end.gif" width="196" height="12"
      border="0" alt='' /></td>
</tr>
 
<tr valign="bottom">
	<td colspan=5 height="10"><img src="/images/nav_grad_top.gif" width="418"
      height=10 alt='' /></td>
</tr>
 
<tr valign="top" style='padding:0px 0px 0px 0px;margin:0px 0px 0px 0px'>
	<td><a href="?MSGHOME.HTML" onmouseover="buttonOn('imgMsg');return true;"
      onmouseout="buttonOff('imgMsg');return true;" target='msgwin'><img
      src="/images/nav_msg_off.gif" width="105" height="12" name="imgMsg"
      border="0" alt='Messaging' /></a></td>
	<td><a href="?CALENDAR.HTML" onmouseover="buttonOn('imgCal');return true;"
      onmouseout="buttonOff('imgCal');return true;"><img
      src="/images/nav_cal_off.gif" width="97" height="12" name="imgCal"
      border="0" alt='Calendar' /></a></td>
	<td colspan=5><img src="/images/nav_grad_bottom.gif" width="200"
      height="12" alt='' /></td>
</tr>
 
</table>
 
<!-- Main Body Table follows: -->
 
<!-- Blocked out in favor of div below (sgc)
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3"></td>
<td width="777">
-->
<div style="margin-left:3px; width:777px;">
<!-- Output from 'HTMLMENU RMS' -->
 
<!-- Using menu 'RMS' from ZMENU-->
 
<div id="RMS" level=0>
<table width='100%' border=0 cellpadding=0 cellspacing=0><tr><td class=separator colspan=3></td></tr>
<tr><td class='MenuTitle' colspan=3>Police Records Web Services</td></tr>
<tr><td class=separator colspan=3></td></tr>
<tr class='NavBarRow'>
  <td id=mnuRMS_QUERIES
 onmouseover="this.className='NavBarBtnOn';showMenu( this, 'RMS.QUERIES');" onmouseout="this.className='NavBarBtn';overChecker('RMS.QUERIES')" width='33%' class='NavBarBtn' title='Perform searches of the records database'><b>Queries&hellip;</b></td>
  <td id=mnuRMS_RECENT_BOLO_HTML
 onmouseover="this.className='NavBarBtnOn'" onmouseout="this.className='NavBarBtn'" onclick="location.href='?RMS.RECENT.BOLO.HTML'" width='33%' class='NavBarBtn' title='Recently updated BOLOs'>Recent BOLOs</td>
  <td id=mnuhttp://saber:8080/ezreports
 onmouseover="this.className='NavBarBtnOn'" onmouseout="this.className='NavBarBtn'" onclick="window.open('/catalyst.csp?Code=XN&Command=http://saber:8080/ezreports','','status=no,resizable=yes,scrollbars=yes')" width='33%' class='NavBarBtn' title='EZ Reports'>EZ Reports</td>
</tr>
</table></div>
<div id="RMS.QUERIES" style='position:absolute; visibility:hidden; z-index:101' onMouseOver="setOver('RMS.QUERIES');" onMouseOut="overChecker('RMS.QUERIES');" level=1>
<table border=0 cellspacing=0 cellpadding=0><tr><td class=NavBarBtn>
<table border=0 cellspacing=1 cellpadding=2>
<tr class='DDrow'>
  <td id=mnuRMS_LQ_ART
 onmouseover="this.className='DDitemOn'" onmouseout="this.className='DDitemOff'" onclick="location.href='?RMS.LQ.ART'" width='100%' class='DDitemOff' title='Search for records regarding an articles'>Articles</td>
</tr>
<tr class='DDrow'>
  <td id=mnuRMS_LQ_CASE
 onmouseover="this.className='DDitemOn'" onmouseout="this.className='DDitemOff'" onclick="location.href='?RMS.LQ.CASE'" width='100%' class='DDitemOff' title='Search for Case files'>Case files</td>
</tr>
<tr class='DDrow'>
  <td id=mnuRMS_LQ_LOC
 onmouseover="this.className='DDitemOn'" onmouseout="this.className='DDitemOff'" onclick="location.href='?RMS.LQ.LOC'" width='100%' class='DDitemOff' title='Search for records regarding a location'>Location</td>
</tr>
<tr class='DDrow'>
  <td id=mnuRMS_LQ_PERSON
 onmouseover="this.className='DDitemOn'" onmouseout="this.className='DDitemOff'" onclick="location.href='?RMS.LQ.PERSON'" width='100%' class='DDitemOff' title='Search for records regarding a person'>Person</td>
</tr>
<tr class='DDrow'>
  <td id=mnuRMS_LQ_PHONE
 onmouseover="this.className='DDitemOn'" onmouseout="this.className='DDitemOff'" onclick="location.href='?RMS.LQ.PHONE'" width='100%' class='DDitemOff' title='Search for records on a phone number'>Phone Number</td>
</tr>
<tr class='DDrow'>
  <td id=mnuRMS_LQ_RA
 onmouseover="this.className='DDitemOn'" onmouseout="this.className='DDitemOff'" onclick="location.href='?RMS.LQ.RA'" width='100%' class='DDitemOff' title='Search for records based on an address'>Residential Address&nbsp;&nbsp;</td>
</tr>
<tr class='DDrow'>
  <td id=mnuRMS_LQ_VEHICLE
 onmouseover="this.className='DDitemOn'" onmouseout="this.className='DDitemOff'" onclick="location.href='?RMS.LQ.VEHICLE'" width='100%' class='DDitemOff' title='Search for records about a vehicle'>Vehicle</td>
</tr>
<tr class='DDrow'>
  <td id=mnuWEB_RUNLIST+WEB_ACCIDENT_REVIEW
 onmouseover="this.className='DDitemOn'" onmouseout="this.className='DDitemOff'"onclick=" window.open('?WEB.RUNLIST+WEB.ACCIDENT.REVIEW','_blank')" width='100%' class='DDitemOff' title='Displays Accidents within a Date Range in HTML FOrmat'>Accident Review</td>
</tr>
<tr class='DDrow'>
  <td id=mnuWEB_RUNLIST+WEB_ACCIDENT_EXTRACT
 onmouseover="this.className='DDitemOn'" onmouseout="this.className='DDitemOff'"onclick=" window.open('?WEB.RUNLIST+WEB.ACCIDENT.EXTRACT','_blank')" width='100%' class='DDitemOff' title='Extracts Accidents within a Date Range to an Excel Spreadsheet'>Accident Extract</td>
</tr>
<tr class='DDrow'>
  <td id=mnuWEB_RUNLIST+WEB_BURGLARY_EXTRACT_HTML
 onmouseover="this.className='DDitemOn'" onmouseout="this.className='DDitemOff'"onclick=" window.open('?WEB.RUNLIST+WEB.BURGLARY.EXTRACT.HTML','_blank')" width='100%' class='DDitemOff' title='Displays Burglaries in a Browser'>Burglary Review</td>
</tr>
<tr class='DDrow'>
  <td id=mnuWEB_RUNLIST+WEB_ARREST_REVIEW
 onmouseover="this.className='DDitemOn'" onmouseout="this.className='DDitemOff'"onclick=" window.open('?WEB.RUNLIST+WEB.ARREST.REVIEW','_blank')" width='100%' class='DDitemOff' title='Displays Arrests in a Browser'>Arrest Review</td>
</tr>
<tr class='DDrow'>
  <td id=mnuWEB_RUNLIST+WEB_ARREST_CSV
 onmouseover="this.className='DDitemOn'" onmouseout="this.className='DDitemOff'"onclick=" window.open('?WEB.RUNLIST+WEB.ARREST.CSV','_blank')" width='100%' class='DDitemOff' title='Extracts Arrests Within a Date Range to an Excel Spreadsheet'>Arrest Extract</td>
</tr>
<tr class='DDrow'>
  <td id=mnuWEB_RUNLIST+WEB_CI_REVIEW
 onmouseover="this.className='DDitemOn'" onmouseout="this.className='DDitemOff'"onclick=" window.open('?WEB.RUNLIST+WEB.CI.REVIEW','_blank')" width='100%' class='DDitemOff' title='Displays Case Investigations in a Browser'>CI Review</td>
</tr>
<tr class='DDrow'>
  <td id=mnuWEB_RUNLIST+CI_CROSSTAB_ASSIGN_DISPO
 onmouseover="this.className='DDitemOn'" onmouseout="this.className='DDitemOff'"onclick=" window.open('?WEB.RUNLIST+CI.CROSSTAB.ASSIGN.DISPO','_blank')" width='100%' class='DDitemOff' title='Crosstabulation of Case Investigator/Disposition'>Crosstab CI Inv/Dispo</td>
</tr>
</table></td></tr></table></div>
<p class=heading1>Local Name Query</p>
<!--
-->
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="Author" content="David Leech">
   <meta name="GENERATOR" content="Mozilla/4.75 [en] (Win98; U) [Netscape]">
   <title>Person Report</title>
</head>
<!-- FORMVUE COMMANDS
-->
<body>
<table BORDER=1 CELLSPACING=0 WIDTH="730" bgcolor="CCFFFF">
<tr VALIGN=TOP>
<td><center><b><font face="Arial,Helvetica"><font size=-1>Date/Time Modified</font></font></b>
<br><tt>05/31/2002<br>18:36</tt></center></td>
<td ROWSPAN="2"><center><b><font face="Times New Roman"><font size=+1>
<br></font><font size=+2>LOCAL PERSON RECORD</font></font></b>
</center></td>
<td><center><b><font face="Arial,Helvetica"><font size=-1>MNI/Type</font></font></b>
<br><tt><a title="List all activity for person" href="?WEB.LQW+GET+LQ_TYPE=QW&LQ_VALUE=1*PERSON*047439    ">047439    </a><br>PERSON</center></tt></td>
</tr>
</table>
 
<table BORDER=0 CELLSPACING=0 WIDTH="730" BGCOLOR="black">
<tr VALIGN=TOP>
<td WIDTH=29%><font color="ff3333"><font size=+1><font face="Arial,Helvetica"><b>
&nbsp;</b></font></font></font>
</td>
<td WIDTH=49%>
<font color="yellow"><font size=+1><font face="Arial,Helvetica"><center><b>
&nbsp;</b></center></font></font></font>
</td>
<td WIDTH=22%>
<font color="33FF99"><font size=+1><font face="Arial,Helvetica"><right><b>&nbsp;
</b></right></font></font></font>
</td>
</tr>
</table>
 
<table BORDER=1 CELLSPACING=0 WIDTH="730" bgcolor="CCFFFF">
<tr VALIGN=TOP>
<td COLSPAN=3>
	<table BORDER=0 CELLSPACING=0 WIDTH="100%">
	<tr VALIGN=TOP>
	<td width="7%"><b><font face="Arial,Helvetica"><font size=-2>Name
	<br></font></font></b></td>
	<td width="30%"><b><font face="Arial,Helvetica"><font size=-2>Last</font></font></b>
	<br><tt>JOHN</tt></td>
	<td width="23%"><b><font face="Arial,Helvetica"><font size=-2>First</font></font></b>
	<br><tt>ANNAMMA</tt></td>
	<td width="20%"><b><font face="Arial,Helvetica"><font size=-2>Middle</font></font></b>
	<br><tt></tt></td>
	<td width="20%"><b><font face="Arial,Helvetica"><font size=-2>Suffix</font></font></b>
	<br><tt></tt></td>
	</tr>
	</table>
<td><b><font face="Arial,Helvetica"><font size=-2>DOB</font></font></b>
<br><tt>          </tt></td>
<td><b><font face="Arial,Helvetica"><font size=-2>Sex</font></font></b>
<br><tt>Male</tt></td>
<td><b><font face="Arial,Helvetica"><font size=-2>Race</font></font></b>
<br><tt>White</tt></td>
</tr>
<tr VALIGN=TOP>
<td><b><font face="Arial,Helvetica"><font size=-2>Jacket</font></font></b>
<br><tt>        </tt></td>
<td><b><font face="Arial,Helvetica"><font size=-2>SSN</font></font></b>
<br><tt>   -  -</tt></td>
<td><b><font face="Arial,Helvetica"><font size=-2>FBI</font></font></b>
<br><tt>           </tt></td>
<td><b><font face="Arial,Helvetica"><font size=-2>CII</font></font></b>
<br><tt></tt></td>
<td><b><font face="Arial,Helvetica"><font size=-2>SO</font></font></b>
<br><tt>         </tt></td>
<td><b><font face="Arial,Helvetica"><font size=-2>Dr License</font></font></b>
<br><tt> </tt></td>
</tr>
</table>
 
<!-- FORMVUE COMMANDS
-->
<table BORDER="1" CELLSPACING=0 CELLPADDING=0 WIDTH="730" bgcolor="CCFFFF">
<caption><b><font face="Arial,Helvetica">RESIDENCE</font></b></caption>
<tr VALIGN=TOP bgcolor="99CCFF">
<td WIDTH=10><b><font face="Arial,Helvetica"><font size=-2>No.</font></font></b></td>
<td WIDTH=280><b><font face="Arial,Helvetica"><font size=-2>Address</font></font></b></td>
<td WIDTH=200><b><font face="Arial,Helvetica"><font size=-2>City</font></font></b></td>
<td WIDTH=30><b><font face="Arial,Helvetica"><font size=-2>State</font></font></b></td>
<td WIDTH=70><b><font face="Arial,Helvetica"><font size=-2>Zip</font></font></b></td>
<td WIDTH=70><b><font face="Arial,Helvetica"><font size=-2>Phone</font></font></b></td>
<td WIDTH=70><b><font face="Arial,Helvetica"><font size=-2>Date</font></font></b></td>
</tr>
<!-- FORMVUE commands
-->
<tr VALIGN=TOP>
<td><tt>   1</tt></td>
<td><tt>37950 FREMONT BL&nbsp;</tt></td>
<td><tt>FREMONT&nbsp;</tt></td>
<td><tt>&nbsp;</tt></td>
<td><tt>&nbsp;</tt></td>
<td><tt>574-1765&nbsp;</tt></td>
<td><tt>06/19/1986&nbsp;</tt></td>
</tr>
<!-- FORMVUE commands
-->
</table>
 
<table BORDER="1" CELLSPACING=0 CELLPADDING=0 WIDTH="730" bgcolor="CCFFFF">
<caption><b><font face="Arial,Helvetica">BUSINESS</font></b></caption>
<tr VALIGN=TOP>
<td WIDTH=290><b><font face="Arial,Helvetica"><font size=-2>Occupation</font></font></b>
<br><tt></tt></td>
<td WIDTH=440><b><font face="Arial,Helvetica"><font size=-2>Business Name</font></font></b>
<br><tt></tt></td>
</tr>
</table>
 
<!-- FORMVUE commands
-->
 
<table BORDER="1" CELLSPACING=0 CELLPADDING=0 WIDTH="730" bgcolor="CCFFFF">
<caption><b><font face="Arial,Helvetica">PHYSICAL DESCRIPTION</font></b></caption>
<tr VALIGN=TOP>
<td><b><font face="Arial,Helvetica"><font size=-2>Hair</font></font></b>
<br><tt></tt>
</td>
<td><b><font face="Arial,Helvetica"><font size=-2>Eyes</font></font></b>
<br><tt></tt>
</td>
<td><b><font face="Arial,Helvetica"><font size=-2>Eye Defect</font></font></b>
<br><tt></tt></td>
<td><b><font face="Arial,Helvetica"><font size=-2>Skin Tone</font></font></b>
<br><tt></tt></td>
<td><b><font face="Arial,Helvetica"><font size=-2>Complexion</font></font></b>
<br><tt></tt></td>
<td><b><font face="Arial,Helvetica"><font size=-2>Build</font></font></b>
<br><tt></tt></td>
<td><b><font face="Arial,Helvetica"><font size=-2>Sex</font></font></b>
<br><tt>Male</tt></td>
<td><b><font face="Arial,Helvetica"><font size=-2>Race</font></font></b>
<br><tt>White</tt></td>
<td><b><font face="Arial,Helvetica"><font size=-2>Height</font></font></b>
<br><tt>     </tt></td>
<td><b><font face="Arial,Helvetica"><font size=-2>Weight</font></font></b>
<br><tt>    </tt></td>
</tr>
</table>
 
 
</body>
</html>
<br />
 
 
<!-- FORMS - ZULU.INS.HTML: the footer for the page 
$Id: ZULU.INS.HTML,v 1.2 2006/07/21 22:01:15 rcorbett Exp $ -->
 
<table width="100%" align="left">
 
<tr>
	<td class=separator bgcolor="#999999" colspan=3></td>
</tr>
 
<tr>
	<td class=separator colspan=3></td>
</tr>
 
<tr>
   <td width="20%" valign="top"><a href="http://www.hitech.com" title="Hitech Systems Home"><img src="/images/PoweredByLogo.gif" width="84" height="26" name="button2" border="0"></a></td>
   <td width="60%" valign="top" align="center" class="footer">
	&copy; 2002-2006 Hitech Systems Inc. All rights reserved.<br>
	SafetyNet is a registered trademark of Hitech Systems, Inc.
   </td>
   <td valign="top" align="right" class="footer">as of: 09/17/2009 13:02</td>
</tr>
</table>
 
<!-- End the main body table begun in TOP.INS.HTML -->
 
<!-- Blocked out in favor of div
</td>
</tr>
</table>
-->
</div>
 
</body>
</html>

                                  
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-09-17 at 16:05:22ID24741821
Tags

Java

,

CGI

,

HTML

Topics

CGI Scripting

,

Hypertext Markup Language (HTML)

,

Java Programming Language

Participating Experts
1
Points
500
Comments
5

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. CGI on Windows NT
    I want to setup my Windows NT Server that is running IIS to enable .exe files to execute when accessed via cgi. Currently, when I try to access a CGI program I get the following message: CGI Error The specified CGI application misbehaved by not returning a complete set of ...
  2. CGI and JAVA
    Hi, Where can I find info and resources on developing CGI apps in Java Thanx
  3. CGI and Java
    I'm new to all this and need a hand. I have a web page that that uses a Java script that sets variables, eg., ONCHANGE="window.parent.contents.manufacturer = Manufacturer.options.Item(Manufacturer.options.selectedIndex).value" I need to pick these values up, I...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: ChristoferDutzPosted on 2009-09-18 at 02:48:09ID: 25364227

I'd Suggest using Apache Commons HTTPClient to call the CGI from the server and to relay the response to the client. I think this should be all you need. Just instead of outputting the content read from the cgi to the console, write it to the response of your JSP/Servlet.

Project Homepage:
http://hc.apache.org/httpclient-3.x/
Samples:
http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/examples/

 

by: ChristoferDutzPosted on 2009-09-18 at 02:48:45ID: 25364230

Or include an IFrame in your HTML to load the CGI output from the client :-)

 

by: presynctPosted on 2009-09-21 at 11:38:40ID: 25386036

Thanks a lot for your response Chris. I can use the HTTPClient to call the CGI from the servlet. But regarding the response, I can not just display the results on the browser. I need to process the response values and display them in a predefined format. Since the response is the html page, I dont know how to parse the html page and get the values to display them in a predefined format.

 

by: ChristoferDutzPosted on 2009-09-22 at 04:32:24ID: 25391579

Well in this case I'd suggest making sure the output of the CGI is XHTML or XML and use an Xsl Transformation for converting the response to your desired output.

If you have no influence on the output and it's not Xml/Xhtml I'd suggest using something like http://htmlcleaner.sourceforge.net/ to make it Xml/Xhtml and use this cleaned-up code to do the transformation.

Example Usage of HTMLCleaner:
http://htmlcleaner.sourceforge.net/javause.php

Example Code for Xsl Transformation:
http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html

Hope this helps :-)

 

by: presynctPosted on 2009-09-24 at 22:08:59ID: 31630333

Thanks a lot chris. Actually I have completted first part of this requirement only, but the html cleanup part is not yet completed. I have to get some permissions to do this part. Once I am done with that part, I will let you know the final result. Thanks a lot once again.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...