views:

63

answers:

1

In the Spring docs, the section on multipart support has an example of specifying a multipart form as this:

<form method="post" action="upload.form" enctype="multipart/form-data">

This doesn't use the Spring form tags which I am familiar with and instead submits the form to the upload.form action.

How does Spring know what upload.form means? Do you have to create a mapping for it and, if so, where is this done?

+1  A: 

upload.form is the URL of the HTTP POST request that is created by this form. It will be relative to the URL of the view that generated the form in the first place, so if the form shown above is rendered by /mysite/myapp/myform.html, it will submit to /mysite/myapp/upload.form

It then becomes a matter of configuring Spring to handle "/upload.form" request accordingly, such as through @RequestMapping if you're using annotation-based Spring MVC. See here for more information.

James Earl Douglas