What I did in this instance is store the form that you wish to post, with
all the input types as `hidden' and a string that will be replaced with any
values that go into the form (sort of like how you do a prepared statement),
something like #XXX-VALUE#.  Then at the bottom you have javascript (see
below) that auto-posts the form.  Something like this (the below
html/javascript searches a database for whatever #XXX-VALUE# is replaced
with):

<html>
<body>

<form ACTION="http://cancernet.nci.nih.gov/cgi-bin/srchcgi.exe" METHOD=POST
name="search">
<input type=hidden name="DBID" value=pdq>
<input type=hidden name="SFMT" value="pdq_results/10000/0/0/1">
<input type=hidden name="QUERY" value="stop=0/0/1000/0">
<input type=hidden name="TYPE" value=search>
<INPUT type=hidden name="JSTEST" value="no">
<input type=hidden name="SRCHFORM" value="passthru=:srchform:PDQ:">
<INPUT type=hidden name="SINFO" value="y">
<input type=hidden name="FIELD_100" VALUE="#XXX-VALUE#">
<INPUT type=hidden name="FIELD_100_CTL" value=EXPR>
<INPUT type=hidden name="FIELD_100_ID" value="Text">
<INPUT type=hidden size=11 name="GoButton" value="Search">
<INPUT type=hidden name="FIELD_210" value="[ZFILE]treatment">
<INPUT type=hidden name="FIELD_210_CTL" value=EXPR>
<INPUT type=hidden name="FIELD_210_MOP" value=OR>
<INPUT type=hidden name="FIELD_210" value="(([ZFILE]prevention and
[NAME]prevention) OR [ZFILE]genetics)">
<INPUT type=hidden name="FIELD_210_CTL" value=EXPR>
<INPUT type=hidden name="FIELD_210" value="([ZFILE]screening and
([NAME]screening) OR [NAME] testing)">
<INPUT type=hidden name="FIELD_210_CTL" value=EXPR>
<INPUT type=hidden name="FIELD_210" value="[ZFILE]supportive">
<INPUT type=hidden name="FIELD_210_CTL" value=EXPR>
<INPUT type=hidden name="FIELD_210" value="[ZFILE]facts OR [ZFILE]whatknow
OR [ZFILE]complementary OR [ZFILE]seer">
<INPUT type=hidden name="FIELD_210_CTL" value=EXPR>
<INPUT type=hidden size=11 name="GoButton" value="Search">
</form>

<SCRIPT language="Javascript">
document.search.submit();
</script>

</body>
</html>

Hope I helped-
  ~john

-----Original Message-----
From: Guilherme Ceschiatti [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 5:02 PM
To: Orion-Interest
Subject: URLConnection using the method POST


HI!

I need to make a servlet (or JSP page) to get an external page using the
method POST. Is it possible with the URLConnection class? 

Thanks.
Guilherme Ceschiatti

Reply via email to