本文整理汇总了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();
}