Announcement Announcement Module
Collapse
No announcement yet.
how to use GetAsText() on GET method Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to use GetAsText() on GET method

    Hello,

    I am using annotated controllers and I have two modelAttributes in one controller. When setting up on of the forms I want to call GetAsText() to get some dates in the format yyyy-mm-dd instead of the usual Java.util.Date format with timestamp and everything.

    my setupForm looks like this:
    Code:
    @RequestMapping(method = RequestMethod.GET, value = "/hourRates.htm")
    	public Map<String, Object> setupFormHR (ModelMap model,@RequestParam("assignmentId") int assignmentId){
    
    .....
    
    return model;
    my ProcessSubmit for the same object looks like this:

    Code:
    @RequestMapping(method = RequestMethod.POST, value = "/hourRates.htm")
    	public ModelAndView processSubmitHR(@ModelAttribute("hourRate")
    			HourRate hourRate,BindingResult result, SessionStatus status, ModelMap myModel, HttpServletRequest request){
    
    ....
    
    return new ModelAndView("jsonView", myModel);
    both the GetAsText() and SetAsText() works perfectly fine on the processSubmit method but it doesn't even get called on the setup method.

    Does anyone have a clue to why this happens? How do I get the customDateEditor to get Called also on get method?

    Br
    /Elin
Working...
X