Announcement Announcement Module
Collapse
No announcement yet.
Spring-portlet POST ajax xmlHttpRequest Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring-portlet POST ajax xmlHttpRequest

    Hey,

    Could please anybody who managed to process post xmlHttpRequest with Spring DispatcherPortlet, tell me how to do it ? I'm using YUI io module.

    2010-12-21 10:08:26,206 DEBUG [org.springframework.web.portlet.DispatcherPortlet] HandlerExceptionResolver returned ModelAndView [ModelAndView: reference to view with name 'error'; model is {exception=javax.portlet.UnavailableException:
    No matching handler method found for portlet request: mode 'view', phase 'ACTION_PHASE', parameters map['key1' -> array<String>['value'], 'action' -> array<String>['example2']]}] for exception

    @RequestMapping(params = "action=example2", method = RequestMethod.POST)
    public ResponseEntity<String> responseEntityCustomHeaders() {
    HttpHeaders headers = new HttpHeaders();
    headers.setContentType(MediaType.TEXT_PLAIN);

    System.out.println("-------------------------------------------------------------");
    System.out.println("-------------------------------------------------------------");
    System.out.println("-------------------------------------------------------------");

    return new ResponseEntity<String>("The String ResponseBody with custom header Content-Type=text/plain",
    headers, HttpStatus.OK);
    }

    IT WORKS when ActionMapping is used, but I can't respond to the request in this way

    @ActionMapping(params = "action=example2")
    public void addUploadOrder(ActionRequest actionRequest, ActionResponse response)
    throws SystemException, PortalException, ValidatorException {

    System.out.println("-------------------------------------------------------------");
    System.out.println("-------------------------------------------------------------");
    System.out.println("-------------------------------------------------------------");

    }
    http://i.imgur.com/fB0Mn.png
    http://i.imgur.com/imrlq.png
Working...
X