I am doing encryption and decryption of message at javascript and want to send result message to the spring controller mvc.
@RequestMapping(value = "/token")
public @ResponseBody String getAllBooks(@RequestParam boolean isAuth, @ModelAttribute("somedata") Token data) {
ModelAndView mav = new ModelAndView();
mav.addObject("encryptedToken", data.getValue()); return token;}
Hence the token should hold the value from javascript. I am not using jquery. How to get that value from javascript to Spring mvc controller.
<script>
function Encrypt(msg) {
...................
...................
return encryptedFinally;}
</script>
I want to use this variable (i.e. encryptedFinally) in java controller class.