本文整理匯總了Java中net.ymate.platform.webmvc.view.impl.HttpStatusView.METHOD_NOT_ALLOWED屬性的典型用法代碼示例。如果您正苦於以下問題:Java HttpStatusView.METHOD_NOT_ALLOWED屬性的具體用法?Java HttpStatusView.METHOD_NOT_ALLOWED怎麽用?Java HttpStatusView.METHOD_NOT_ALLOWED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類net.ymate.platform.webmvc.view.impl.HttpStatusView
的用法示例。
在下文中一共展示了HttpStatusView.METHOD_NOT_ALLOWED屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: __doSignCheck
private IView __doSignCheck(InterceptContext context) throws Exception {
String _accountId = WebContext.getRequest().getParameter(IAliPay.Const.APP_ID);
String _sign = WebContext.getRequest().getParameter(IAliPay.Const.SIGN);
//
if (StringUtils.isNotBlank(_accountId) && StringUtils.isNotBlank(_sign)) {
AliPayAccountMeta _meta = AliPay.get().getModuleCfg().getAccountProvider().getAccount(_accountId);
if (_meta != null) {
Map<String, Object> _params = new HashMap<String, Object>(WebContext.getContext().getParameters());
_params.remove(IAliPay.Const.SIGN_TYPE);
_params.remove(IAliPay.Const.SIGN);
//
String _paramsStr = ParamUtils.buildQueryParamStr(_params, false, _meta.getCharset());
if (SignatureUtils.verify(_paramsStr, _sign, _meta.getPublicKey(), _meta.getCharset(), _meta.getSignType())) {
return null;
} else if (_LOG.isDebugEnabled()) {
_LOG.debug("Signature verification failed: " + _paramsStr);
}
}
}
return HttpStatusView.METHOD_NOT_ALLOWED;
}
示例2: __callback
@RequestMapping("/callback")
public IView __callback(@ModelBind AliPayBaseReturn baseReturn) throws Exception {
IView _view = AliPay.get().onReturnCallback(baseReturn);
if (_view == null) {
return HttpStatusView.METHOD_NOT_ALLOWED;
}
return _view;
}
示例3: __doAuthorize
/**
* @param tokenId 令牌唯一標識
* @param uid 用戶唯一標識
* @param remoteAddr 用戶IP地址
* @param sign 參數簽名
* @return 驗證客戶端令牌有效性及狀態
* @throws Exception 可能產生的任何異常
*/
@RequestMapping(value = "/authorize", method = Type.HttpMethod.POST)
public IView __doAuthorize(@VRequired @RequestParam("token_id") String tokenId,
@VRequired @RequestParam String uid,
@VRequired @RequestParam("remote_addr") String remoteAddr,
@VRequired @RequestParam String sign) throws Exception {
if (SSO.get().getModuleCfg().isClientMode()) {
return HttpStatusView.METHOD_NOT_ALLOWED;
}
//
Map<String, String> _params = new HashMap<String, String>();
_params.put("token_id", tokenId);
_params.put("uid", uid);
_params.put("remote_addr", remoteAddr);
//
String _sign = ParamUtils.createSignature(_params, false, SSO.get().getModuleCfg().getServiceAuthKey());
if (StringUtils.equals(sign, _sign)) {
ISSOTokenStorageAdapter _storageAdapter = SSO.get().getModuleCfg().getTokenStorageAdapter();
// 嘗試從存儲中加載原始令牌數據並進行有效性驗證
ISSOToken _token = _storageAdapter.load(uid, tokenId);
if (_token != null) {
boolean _ipCheck = (SSO.get().getModuleCfg().isIpCheckEnabled() && !StringUtils.equals(remoteAddr, _token.getRemoteAddr()));
if (_token.timeout() || !_token.verified() || _ipCheck) {
_storageAdapter.remove(_token.getUid(), _token.getId());
return WebResult.CODE(ErrorCode.USER_SESSION_INVALID_OR_TIMEOUT).toJSON();
} else {
WebResult _result = WebResult.SUCCESS();
// 嘗試加載令牌自定義屬性
ISSOTokenAttributeAdapter _attributeAdapter = SSO.get().getModuleCfg().getTokenAttributeAdapter();
if (_attributeAdapter != null) {
_attributeAdapter.loadAttributes(_token);
if (!_token.getAttributes().isEmpty()) {
_result.data(_token.getAttributes());
}
}
return _result.toJSON();
}
}
}
return WebResult.CODE(ErrorCode.INVALID_PARAMS_VALIDATION).toJSON();
}