Announcement Announcement Module
Collapse
No announcement yet.
$.getJSON() problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    thanks for the reply .analysing code step by step worked ..

    problem is in my controller .When i first access employeeList.jsp page it was expecting a bean with name 'employee' . because i included emploee update form as well as displaying employee list code in the same page , when i access this page for the first time i need to take care of both . Form is expecting an 'Employee' object or 'command' object and in my table i need to display employee list.

    I updated my code from

    Code:
    @RequestMapping(method=RequestMethod.GET)
    	public ModelAndView getEmployeeList(Model model) {
    		
    		String now = (new Date()).toString();
    		Map<String, Object> myModel = new HashMap<String, Object>();
            myModel.put("now", now);
            myModel.put("employees", getEmployeeDao().getEmployees());
     
    
            return new ModelAndView ("emp/employeeList",model,myModel);
    
    	}

    to


    Code:
    @RequestMapping(method=RequestMethod.GET)
    	public String getEmployeeList(Model model) {
    		
    		String now = (new Date()).toString();
    		Map<String, Object> myModel = new HashMap<String, Object>();
            myModel.put("now", now);
            myModel.put("employees", getEmployeeDao().getEmployees());
             
            model.addAttribute("employee",new Employee());
            model.addAttribute("model" , myModel);
            return "emp/employeeList";
    
    	}

    Comment


    • #17
      i had a problem in Json

      I'm trying to use json with YUI in spring project and i have the following error :

      No mapping found for HTTP request with URI [/pashajobs-web/landmarks/64/17.json] and i'm using this call "YAHOO.util.Connect.asyncRequest('GET', 'landmarks/' + countryId + '/' + cityId + '.json', callback);"

      in my conroller the mapping as the following:
      @RequestMapping("/landmarks/{countryId}/{cityId}")
      thanks in advance.

      Comment

      Working...
      X