我在web服务新的,目前能够通过调用运行我的查询https://localhost/application/service/v1.0/contacts/account= {帐户ID} 我想让我的URL看起来像https://localhost/application/service/v1.0/contacts?account= {帐户ID}参数传递
可我知道如何做到这一点不使用QueryParam?我在Spring 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;
}
}
可否请你调试这个控制器检查,如果'accountId'是建立与2465543400 ?别忘了我已经在两个地方更改了你的代码。 – Blank
它的工作。一些问题是与ID。非常感谢 – ronypatil