Hi,
The list archive search doesn't appear to work to forgive me if this is a simple and already answered topic.
 
I have an actionform that has an object as a property - Premises premises, and a jsp that uses <html:text name="Premises" property="premises.name" />.
When I use createPremises.jsp all is ok and the values for premises get through to my action no problem.
 
The problem I have though is when I want to edit premises. The action (extending Dispatchaction) viz...
 
public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
  PremisesForm premForm = (PremisesForm) form;
  String returnMapping = "edit";
  Long id = null;
  if (request.getParameter("id") != null)
   id = new Long(request.getParameter("id"));
  if (id == null)
   id = (Long) request.getAttribute("id");
  try {
   PremisesDAO pdao = new PremisesDAO();
   Premises prem = pdao.getPremises(id);
   premForm.setPremises(prem);
   premForm.setOwner(prem.getOwner());
   request.setAttribute("Premises", premForm);
  } catch (DataAccessException e) {
   e.printStackTrace();
   returnMapping = "error";
   request.setAttribute("error", e.getMessage());
  }
  return mapping.findForward(returnMapping);
 }
which is fine and sets the PremisesForm premises attribute correctly. However when this gets submitted ultimately from the jsp, the properties of premises that aren't html:text elements in my jsp aren't being retained. e.g. id (primary key of premises from db, and other things like collections of other pojo's in premises.
 
So the question is this - how do I retain values of nested properties that aren't required to be (or cannot be) represented in the jsp? It appears that the value of premises is always null and not using what is in the request scope when the jsp is submitted.
 
I am sure this is simple answer but I just can't get it!
 
TIA
Conrad
 
 

Conrad Crampton
Software Solutions Manager
Force Headquarters
11 Edinburgh Square
Sutton Road
Maidstone
ME15 9BZ
01622 653283 (ext)
19-3283 (internal)
07814 011752 (mobile)
This Email and any accompanying document(s) contain information from Kent 
Police, which is confidential or privileged.
The information is intended to be for the exclusive use of the individual(s) or 
bodies to whom it is addressed.
If you are not the intended recipient be aware that any disclosure, copying, 
distribution or use of the contents of this information is prohibited.
If you have received this Email in error please notify us by telephone 
immediately.
The copyright in the contents of this email and any enclosures is the property 
of Kent Police and any unauthorised reproduction or disclosure is contrary to 
the provisions of the Copyright Designs and Patents Act 1988.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to