title: spring mvc decoding + is being replaced with space
body: <p>I have problem in Spring MVC pattern. When i call the web service form iPhone app with encoded value, The decoding is not happening properly. Not sure about what the issue is.
  the + sign is getting replaced with a space " ".
  Below is my web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;br&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br&gt;
  xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&lt;br&gt;
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&lt;br&gt;
  id="WebApp_ID" version="3.0"&gt;&lt;br&gt;
  &lt;display-name&gt;APPLICATIONNAME&lt;/display-name&gt;&lt;br&gt;
  &lt;filter&gt;&lt;br&gt;
  &lt;filter-name&gt;encoding-filter&lt;/filter-name&gt;&lt;br&gt;
  &lt;filter-class&gt;org.springframework.web.filter.CharacterEnco dingFilter&lt;/filter-class&gt;&lt;br&gt;
  &lt;init-param&gt;&lt;br&gt;
  &lt;param-name&gt;encoding&lt;/param-name&gt;&lt;br&gt;
  &lt;param-value&gt;UTF-8&lt;/param-value&gt;&lt;br&gt;
  &lt;/init-param&gt;&lt;br&gt;
  &lt;init-param&gt;&lt;br&gt;
  &lt;param-name&gt;forceEncoding&lt;/param-name&gt;&lt;br&gt;
  &lt;param-value&gt;true&lt;/param-value&gt;&lt;br&gt;
  &lt;/init-param&gt;&lt;br&gt;
  &lt;/filter&gt;&lt;br&gt;
  &lt;filter-mapping&gt;&lt;br&gt;
  &lt;filter-name&gt;encoding-filter&lt;/filter-name&gt;&lt;br&gt;
  &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;&lt;br&gt;
  &lt;/filter-mapping&gt;&lt;br&gt;
  &lt;servlet&gt;&lt;br&gt;
  &lt;servlet-name&gt;spring&lt;/servlet-name&gt;&lt;br&gt;
  &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherSe rvlet&lt;/servlet-class&gt;&lt;br&gt;
  &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;&lt;br&gt;
  &lt;/servlet&gt;&lt;br&gt;
  &lt;servlet-mapping&gt;&lt;br&gt;
  &lt;servlet-name&gt;spring&lt;/servlet-name&gt;&lt;br&gt;
  &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;&lt;br&gt;
  &lt;/servlet-mapping&gt;&lt;br&gt;
  &lt;welcome-file-list&gt;&lt;br&gt;
  &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;&lt;br&gt;
  &lt;/welcome-file-list&gt;&lt;br&gt;
  &lt;/web-app&gt;&lt;br&gt;
  </code></pre>
  
  <p>My controller class </p>
  
  <pre><code>@Controller
  public class LoginController {
  
  @Autowired
  private LoginServiceImpl loginService;
  
  @RequestMapping(value = "/getUserDetails", method = RequestMethod.POST)
  public @ResponseBody
  LoginData getUserDetails(@ModelAttribute LoginDetails loginDetails) {
  LOGGER.debug("Session ID = " + loginDetails.getSessionID());
  }
  </code></pre>
  
  <p>Sample input request from iPhone APP</p>
  
  <pre><code>NSURLResponse *response = nil;
  NSError *error = nil;
  NSString *urlString = @"http://localhost:8080/rest/getUserDetails";
  NSURL *url = [NSURL URLWithString:urlString];
  NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:url];
  NSURLConnection *connection= [[NSURLConnection alloc] initWithRequest:urlRequest
                                                               delegate:self];
  [urlRequest setHTTPMethod:@"POST"];
  NSString *postString = [NSString stringWithFormat:@"sessionID=%@",@"ABCD+/EFGH"];
  NSData *a=[postString dataUsingEncoding:NSUTF8StringEncoding];
  NSLog(@"encoded %@",a);
  [urlRequest setHTTPBody:a];
      [connection start];
  NSString *returnString = [[NSString alloc] initWithData:[NSURLConnection sendSynchronousRequest:urlRequest returningResponse:&amp;response error:&amp;error] encoding:NSUTF8StringEncoding];
  
  NSLog(@" %@ ",returnString);
  NSLog(@"%@",error);
  </code></pre>
  
  <p>On the server side instead of "ABCD+/EFGH" i am getting "ABCD /EFGH". SO the plus (+) is not getting decoded. 
  What needs to be done to get the plus (+) on the server? Any help is appreciated. </p>