J
Jimi Hullegård
I have a servlet that is responsible for all links/input on a site. That is,
all links and forms point to that servlet. Do tell what action to take, I
use parameters, like this:
<a href="/controller?action=showLoginPage">Login</a>
and:
<form method="post" action="/controller">
<input type="hidden" name="action" value="sendMessage">...
All that works perfect. But now I want to add the possibillity to upload a
image as an attachment to the message. I found a good tutorial on
TheServerSide
(http://www.theserverside.com/articles/article.tss?l=HttpClient_FileUpload)
that worked. But when I try to use this with my own servlet, it fails. The
thing is that I want to mix regular text inputs with that file input, in the
same form. And also, I want to handle that request the same way (being able
to do request.getParameter("someParameterName") in the servlet. But when I
use enctype="multipart/form-data" in the form, the
request.getParameter("action") returns null.
Is there a solution to this?
Regards
/Jimi
all links and forms point to that servlet. Do tell what action to take, I
use parameters, like this:
<a href="/controller?action=showLoginPage">Login</a>
and:
<form method="post" action="/controller">
<input type="hidden" name="action" value="sendMessage">...
All that works perfect. But now I want to add the possibillity to upload a
image as an attachment to the message. I found a good tutorial on
TheServerSide
(http://www.theserverside.com/articles/article.tss?l=HttpClient_FileUpload)
that worked. But when I try to use this with my own servlet, it fails. The
thing is that I want to mix regular text inputs with that file input, in the
same form. And also, I want to handle that request the same way (being able
to do request.getParameter("someParameterName") in the servlet. But when I
use enctype="multipart/form-data" in the form, the
request.getParameter("action") returns null.
Is there a solution to this?
Regards
/Jimi