spring mvc - Moving data between MVC objects -


I have 2 tables with a key = PID is a list of parts with the list of second partitions in this way I am currently setting up the controller.

  @RequestMapping ("/ addNewParttickets") Public Model and View ViewNaturalism (@RequestParam Integer pidKey) {ModelAndView mav = New ModelAndView (); Mav.addObject ("Parts", partsDAO.findPartsByPrimaryKey (pidKey)); Mav.addObject ("parttickets", New Particulate ()); Mav.addObject ("newflag" is true); Mav.setViewName ("parttickets / addNewParttickets.jsp"); Return mawa; }  

My question is, how can I set partickets.pid = parts.pid? What would it be best to do in addObject calls? (If so, how?) Or is it best as part of the form setup in the JSP file? Or am I completely in the left area and do I need to do more research?

I was thinking about it wrong. Easy enough to do -

  Partitions Partx = new parts (); Parts Parts = Partside.comFindPartSpeed ​​(PDK); Parttickets.setPid (parts.getPid ());  

Comments