Im trying to write a controller and a form that can handle a multipart file upload and some other data passing.
First i made the basic form like this:
<form:form method="POST" commandName="myForm">
then everything fine, but no multipart handling of course. Then i add the enctype part like this:
<form:form method="POST" commandName="myForm" enctype="multipart/form-data">
Then my whole form is messed up and all the attribuets gives NullPointers. Not even a simple String name attribute working. Also i added:
<beans:bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />
So i really got no idea whats the problem. Any comment would help a lot. Thnaks in advance.
We are using CommonsMultipartResolver in our project. It goes like this. In your applicationContext.xml:
Then cast yout request to MultipartHttpServletRequest: