I have found few questions on this topic however it does not necessary answer my question
Basicaly
I am passing some values via url
so data can be gathered from database. I can do it via method= RequestMethod.GET
however I would like to do it via POST
so users doesnt see parameters in URL.
I am not sure i am using the best method, i bet there is something much advance in order to achieve this .
Cotroller class
@RequestMapping(value="/empresa", method= RequestMethod.POST)
public String empresa(Model model, Principal principal, @RequestParam("get_Business_ID") String get_Business_ID){
// get selected business
List<Business> selectedBusiness = businessService.getBusinessByBusinessID(get_Business_ID);
System.out.println("business selected= "+ selectedBusiness.get(0).getBusiness_name());
model.addAttribute("selectedBusiness",selectedBusiness);
//Destaque semanal
List<Business> businessList = businessService.getCurrentBusiness();
model.addAttribute("businessList", businessList);
return "empresa";
}
JSP page link
href="${pageContext.request.contextPath}/empresa?get_Business_ID=${business.business_id}"
error Type Status Report
Message Request method 'GET' not supported
Description The method received in the request-line is known by the origin server but not supported by the target resource.
maybe RequestMethod.GET only works if i am using a form with post method?
Is there any other way to achieve this?
Thanks in advance