ich an einen Web Service neu bin und derzeit in der Lage meine Abfrage auszuführen durch den Aufruf https://localhost/application/service/v1.0/contacts/account= {accountId} Ich möchte meine URL wie aussehen https://localhost/application/service/v1.0/contacts?account= {accountId}vorbei Parameter in Webservice API
Darf ich wissen, wie dies zu erreichen nicht mit QueryParam? Ich arbeite im Frühjahr mvc
@Controller
public class ContactListResponseController extends BaseWebServiceController
{
public static final String PATH = "/v" + VERSION + "/contacts/account={accountId}";
@Autowired
private ContactService contactService;
@RequestMapping(value = PATH, method = RequestMethod.GET)
@ResponseBody
public ContactListResponseBean doGetMyAssignedAccounts (@PathVariable String accountId,
HttpServletRequest request,
HttpSession session,
HttpServletResponse response,
@ModelAttribute(User.USER_REQUEST_VAR) User user)
throws Exception
{
List<ContactSummaryWebServiceBean> contactList = contactService.getContactsListForCallPointWebService(accountId);
ContactListResponseBean result = new ContactListResponseBean(contactList);
return result;
}
}
Könnten Sie bitte diesen Controller Check debuggen, wenn die 'accountId' Setup war mit 2465543400 ? Und vergiss nicht, dass ich deinen Code an zwei Stellen geändert habe. – Blank
Es hat funktioniert. ein Problem war mit ID. Vielen Dank – ronypatil