title: Upload file and send parameters to spring portlet controller
body: <p>Can any one of you tell me how to upload a file and also pass a input parameter to the controller using spring mvc portlet controller ?</p>
  
  <p>Action URL and form in jsp :</p>
  
  <pre><code>&lt;portlet:actionURL var="addDetailsURL"&gt; 
      &lt;portlet:param name="addDetails" value="addDetailsValue"/&gt; 
  &lt;/portlet:actionURL&gt;
  
  
  &lt;div id = "&lt;portlet:namespace/&gt;addDetailsDIV" &gt;
      &lt;form action="${addDetailsURL}" enctype="multipart/form-data" method="post"&gt;
  
          &lt;input style="display:block;" type="text" name="selectedDetail" id='selectedDetail'/&gt; &lt;%-- holds the parameter that is supposed to be passed to the controller --%&gt;
          &lt;table width = 100% cellspacing="5" cellpadding="5"&gt;
              &lt;tr&gt;
                  &lt;td colspan='2'&gt;&lt;fmt:message key = "selectFileUploadTxt"/&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td colspan='2'&gt;&lt;input id="uploadedFile" type="file" name="uploadedFile" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td &gt;
                  &lt;span id="&lt;portlet:namespace /&gt;closeAddDetailDia"&gt;cancel&lt;/span&gt;
                  &lt;/td&gt;
                  &lt;td align="left"&gt;
                  &lt;Button id="uploadButton"&gt;&lt;fmt:message key="addDetailButtonTxt" /&gt;&lt;/Button&gt;
  
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>On submit the request goes to the controller but the "selectedDetail" parameter is null.</p>
  
  <p>Controller code :</p>
  
  <pre><code>@RequestMapping("VIEW")
  public class AddDetailsController {
  
      /**
       * 
       * @param actionRequest
       * @param actionResponse
       * @return
       * @throws IOException 
       */
      @SuppressWarnings({ "rawtypes", "unused" })
      @ActionMapping(params = "addDetails=addDetailsValue")
      public String fileUpload(ActionRequest actionRequest, ActionResponse actionResponse,
          @RequestParam String selectedDetail
              ) throws PortletException, IOException {
          System.out.println("selectedDetail : " + selectedDetail); // it is null
          System.out.println("selectedDetail : " + actionRequest.getParameter("selectedDetail")); // it is null
  </code></pre>
  
  <p>The file upload part is working fine but I am not getting the "selectedDetail" parameter. Please help .</p>
  
  <p>Environment Details </p>
  
  <ol>
  <li>WebSphere Portal v7002</li>
  <li>IDE - RAD v8.5</li>
  <li>Spring version 3.1.0</li>
  </ol>
  
  <p>Please let me know if you need any other detail.</p>