Results 1 to 2 of 2

Thread: Spring 3 + Freemarker binding issue

  1. #1
    Join Date
    Apr 2011
    Posts
    18

    Default Spring 3 + Freemarker binding issue

    I am facing a problem with <@spring bind ... /> macro in FTL .

    Question 1 : is <@spring bind .. /> macro adhere to Java 5 features ?

    Let me explain my issue :
    My Domain Objects:
    Code:
    class ParentRecord{
    
    private String rawData;
    
    //getters & setters ..
    }
    
    
    class ARecord extends ParentRecord{
    
    String orginalValue;
    
    //getters & setters ..
    
    }
    
    class BRecord extends ParentRecord{
    
    String previousValue;
    
    //getters & setters ..
    
    }
    My Model Attribute:
    Code:
    class JobRecords{
    
    List<? extends ParentRecord> list= new ArrayList<ParentRecord>();
    //getters & setters ..
    
    }
    Controller:
    Code:
    @RequestMapping(value = "/jobs/pre/{jobName}", method = RequestMethod.POST)
    	public String launch(ModelMap model@ModelAttribute("jobRecords") JobRecords jobRecords,Errors errors,..){
    ...
    jobRecords.setList(records);
    ...
    In the above method based on the jobName , corresponding list of objects will be added (i.e List of ARecord or BRecord) .

    From the FTL , I am able to access the model attriubtes values.
    Code:
    ..
    <@spring.bind "jobRecords.list[${content_index}].originalvalue" />			<td><input type="text"							name="${spring.status.expression}"							value="${spring.status.value?default("")}"  /></td>
    ..
    when I post the form , it unable to dynamic object (ARecord) contents .I can figure out that Spring bind macro has only intialized List of ParentRecords not list of Arecord objects will submission .

    Can any one help me in resolving this issue

  2. #2
    Join Date
    Apr 2011
    Posts
    18

    Default

    Any One help me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •