-
Bug
-
Resolution: Fixed
-
Critical
-
None
-
None
-
Security Level: Public
-
None
With previous AJS Framework, when REST call was done wiht a Parameter typed Array, it was rerieve aas follow ...
@POST @Path("myRestService/{pathParam}") // @Consumes ({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN}) public Response performAction( @Context HttpServletRequest _request, @PathParam("pathParam") String _pathParam, @QueryParam("queryParam") final String _queryParam) { List listValue = new ArrayList(); Map requestParams = _request.getParameterMap(); if ( requestParams.containsKey("arrayParam") ) { String[] arrayParam = (String[]) _request.getParameterMap().get("arrayParam"); for (int i = 0; i < arrayParam.length; i++) { listValue.add((String) arrayParam[i]); } } ...
Now, the it seems to be usable as follow
@POST @Path("myRestService/{pathParam}") // @Consumes ({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN}) public Response performAction( @Context HttpServletRequest _request, @PathParam("pathParam") String _pathParam, @QueryParam("queryParam") final String _queryParam, @QueryParam("arrayParam[]") final String[] _arrayParam ) { List listValue = new ArrayList(); for (int i = 0; i < _arrayParam.length; i++) { listValue.add((String) arrayParam[i]); } ...
For compatibilities reason, it is maintained as follow :
@POST @Path("myRestService/{pathParam}") // @Consumes ({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN}) public Response performAction( @Context HttpServletRequest _request, @PathParam("pathParam") String _pathParam, @QueryParam("queryParam") final String _queryParam) { List listValue = new ArrayList(); Map requestParams = _request.getParameterMap(); if ( requestParams.containsKey("arrayParam[]") ) { String[] arrayParam = (String[]) _request.getParameterMap().get("arrayParam"); for (int i = 0; i < arrayParam.length; i++) { listValue.add((String) arrayParam[i]); } } if ( requestParams.containsKey("arrayParam") ) { String[] arrayParam = (String[]) _request.getParameterMap().get("arrayParam"); for (int i = 0; i < arrayParam.length; i++) { listValue.add((String) arrayParam[i]); } }