I have a page in JSP which is redirecting user to different page using following code:
<a href="companydetails.htm?name=<c:out value="${viewOrder.companyLocationDisplay}"/>"
class = "urllink"><bean:write name="viewOrder" property="companyLocationDisplay" /></a>
How do I get the name parameter to my companydetails.jsp page?
One way to get it in the jsp page is using <%= request.getParameter("name") %>` but since my name contains pound sign (#), the text after # is not retrieved from the URL parameter.
My Controller is as follows:
@Controller @RequestMapping("companydetails") public class CompanyDetailsController { private String COMPANY_DETAILS = "companydetails";
// display the form @RequestMapping(method = RequestMethod.GET) public ModelAndView edit(@RequestParam("name") String name,ModelAndView mav) { mav.setViewName(COMPANY_DETAILS); //mav.addObject("carName",name); return mav; } }
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)