次のようにパラメーターを送信する必要があります。
writer.append("--" + boundary).append(CRLF);
writer.append("Content-Disposition: form-data; name=\"" + urlParameterName + "\"" )
.append(CRLF);
writer.append("Content-Type: text/plain; charset=" + charset).append(CRLF);
writer.append(CRLF);
writer.append(urlParameterValue).append(CRLF);
writer.flush();
サーブレット側では、フォーム要素を処理します。
items = upload.parseRequest(request);
Iterator iter = items.iterator();
while (iter.hasNext()) {
item = (FileItem) iter.next();
if (item.isFormField()) {
name = item.getFieldName();
value = item.getString();
}}