You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Philipp Leusmann <ph...@post.rwth-aachen.de> on 2003/01/19 16:13:57 UTC

Don´t get any parameters when POSTing a from to a velocity-servlet

Hi,

currently I am trying to write a servlet which processes uploaded files.
The problem is, that when setting the form-method="post" the servlet doesn´t
get any parameters. (request.getParameterNames returns null).
With the form-method set to "get" the parameters are received, but no
content-type is sent by tomcat. Due to this, commons-fileupload always
throws an exception.

My vm-file looks like this (this is only the form I use. The rest of the
page is generated by another servlet which doesn´t get the Parameters as
well):
----snip----
<form action="$composemailpage" method="post" enctype="multipart/form-data">
<table cellspacing="2" cellpadding="2" border="0">
<tr>
    <td>An:</td>
    <td><input type="text" name="to" value="$!to"></td>
</tr>
<tr>
    <td>Cc:</td>
    <td><input type="text" name="cc" value="$!cc"></td>
</tr>
<tr>
    <td>Bcc:</td>
    <td><input type="text" name="bcc" value="$!bcc"></td>
</tr>
<tr>
    <td>Betreff:</td>
    <td><input type="text" name="subject" value="$!subject"></td>
</tr>
<tr>
    <td></td>
    <td></td>
</tr>
<tr>
    <td colspan="2"><textarea cols="100" rows="15" name="body">$!body
</textarea>
</td>
</tr>
</table>
Attachment hinzuf&uuml;gen:
<input type="file" name="fileName" size="80">
<input type="submit" name="uploadAttachment" value="Attachment anfügen">
<br><br>
<input type="submit" name="send" value="Mail senden"><input type="reset"
value="Felder löschen">
</form>
----snip----

Anyone has an Idea, why receiving the parameters doesn´t work?
You can get the generated full page here:
http://www.uwf.rwth-aachen.de/velocity-troublepage.html.txt

Another question, which is maybe a bit off-topic: Why is the content-type
not sent when doing get?

Hope someone can help me,
 Philipp



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>