Thanks for your response But I didn't get any exception that the persistenceManager connection is closed It just didn't save without giving any errors and persistenceManager's detachCopy also didn't save On Nov 17, 2:16 am, Rusty Wright <[email protected]> wrote: > Forgot to add; here's how I used it in my web.xml: > > <filter> > <filter-name> > OpenPersistenceManagerInViewFilter > </filter-name> > > <filter-class> > > org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter > </filter-class> > </filter> > > <filter-mapping> > <filter-name> > OpenPersistenceManagerInViewFilter > </filter-name> > > <url-pattern>/*</url-pattern> > </filter-mapping> > > The other thing you could do is use the persistenceManager's detachCopy > method on anything you're sending out to the web view layer. > > > > Ibrahim Hamza wrote: > > Dear All > > I useJDO with spring > > and when i add @ModelAttribute("countries") > > All things go fine except the data notsavedwithout any exception > > When query from another datastore > > > @Controller > > public class PortController { > > > private static final String FORM_MODEL_KEY = "ports"; > > > private static final String FORM_UPDATE_KEY = "port/Edit"; > > > private static final String REDIRECT_LIST_VIEW_KEY = "redirect:/port/ > > home.htm" ; > > > @Autowired > > private PortDAO portDAO; > > @Autowired > > private CountryDAO countryDAO; > > > public PortController() {} > > > @InitBinder > > protected void initBinder(HttpServletRequest request, > > ServletRequestDataBinder binder) throws Exception { > > binder.registerCustomEditor(String.class, new > > StringTrimmerEditor(false)); > > binder.registerCustomEditor > > (com.xesolution.domain.Country.class, new CountryEditor(countryDAO)); > > > } > > > @RequestMapping(value="/port/home.htm") > > public ModelMap list() { > > return new ModelMap(FORM_MODEL_KEY,portDAO.readAll()); > > } > > @RequestMapping(value="/port/new.htm") > > public ModelAndView create(){ > > Port port = new Port(); > > return new ModelAndView(FORM_UPDATE_KEY,FORM_MODEL_KEY,port); > > } > > �...@requestmapping(value="/port/update.htm") > > public ModelAndView update(@RequestParam("id") String id) { > > Port result = portDAO.read(id); > > return new ModelAndView(FORM_UPDATE_KEY,FORM_MODEL_KEY, result); > > } > > > @RequestMapping(value="/port/save.htm", method = RequestMethod.POST) > > public ModelAndView save(@ModelAttribute(FORM_MODEL_KEY) Port port, > > BindingResult result, SessionStatus status) { > > > new PortValidator().validate(port, result); > > if (result.hasErrors()) > > { > > return new ModelAndView(FORM_UPDATE_KEY, FORM_MODEL_KEY, > > port); > > } > > else > > { > > portDAO.persist(port); > > return new ModelAndView(FORM_UPDATE_KEY, FORM_MODEL_KEY, port); > > return new ModelAndView(REDIRECT_LIST_VIEW_KEY, list()); > > } > > } > > > �...@modelattribute("countries") > > public List<?> populateCountry() { > > //this make data notsaved > > return countryDAO.readAll(); > > //But this make the datasaved > > //return portDAO.readAll(); > > } > > > public void setPortDAO(PortDAO portDAO) { > > this.portDAO = portDAO; > > } > > } > > and this is jsp line which display the form select > > <form:select path="country" items="${countries}" itemLabel="name" > > itemValue="id"/> > > > -- > > > You received this message because you are subscribed to the Google Groups > > "Google App Engine for Java" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > For more options, visit this group > > athttp://groups.google.com/group/google-appengine-java?hl=.
-- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=.
