i hav created a jsp page from which i m taking some values and on submit it should pass the parameters to the java class using rest.
< form id="payment" method="post" action="addtogroup">
< ol style="padding: 0;">
< li>< label for="groupId">Group id:< /label>
< input type="text" id="groupId" name="groupId"/>
< br />
< li>< label for="vendorId">Profile Id :< /label>
< input type="text" id="vendorId" name="vendorId"/>
< li> < input type="submit" value="Submit"/> < br /> < /ol>
< /form>
and the java code is:
@RequestMapping(value = "/addtogroup/{groupId}/{vendorId}",method = RequestMethod.POST)
public String addtoGroup(@ModelAttribute("groupId") String groupId,@ModelAttribute("vendorId") String profileId){
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
String username = auth.getName();
System.out.println("group id is="+groupId);
System.out.println("profileId is="+profileId);
System.out.println("username is="+username);
grpDao.addToGroup(groupId,profileId,username);
return "addtogroup";
}
when i type [http://localhost:8080/biznex/rest/addtogroup/2/13] in the address bar directly the code is executed. but when i click submit button in the jsp i get page not found error. plz help me out.