-
Dec 4th, 2012, 11:51 PM
#1
Spring MVC decoding
Hi All,
I have a decoding problem in spring MVC, From the iPhone App i am trying to send the session Id (which contains all characters, special characters ) after decoding the "+" symbol is replaced with " "(space ) . Can some one please help me in this?
Below is the controller class
@Controller
public class LoginController {
@Autowired
private LoginServiceImpl loginService;
@RequestMapping(value = "/getUserDetails", method = RequestMethod.POST)
public @ResponseBody
LoginData getUserDetails(@ModelAttribute LoginDetails loginDetails) {
LOGGER.debug("Service Token = " + loginDetails.getServiceToken());
}
Web.xml file
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>APPLICATIONNAME</display-name>
<filter>
<filter-name>encoding-filter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEnco dingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encoding-filter</filter-name>
<url-pattern>/rest/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
-
Dec 21st, 2012, 12:46 AM
#2
Nice post. Truly inspiring and I also like the language used. Just felt like it transported me to another world. Keep it up. Thanks for a new update.
Last edited by jer; Mar 4th, 2013 at 01:09 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules