private void preventDoubleSubmission(ActionContext context) { if (null == dspToken) { return; } H.Request req = context.req(); if (req.method().safe()) { return; } String tokenValue = context.paramVal(dspToken); if (S.blank(tokenValue)) { return; } H.Session session = context.session(); String cacheKey = S.concat("DSP-", dspToken); String cached = session.cached(cacheKey); if (S.eq(tokenValue, cached)) { throw Conflict.get(); } session.cacheFor1Min(cacheKey, tokenValue); }
private void preventDoubleSubmission(ActionContext context) { if (null == dspToken) { return; } H.Request req = context.req(); if (req.method().safe()) { return; } String tokenValue = context.paramVal(dspToken); if (S.blank(tokenValue)) { return; } H.Session session = context.session(); String cacheKey = S.concat("DSP-", dspToken); String cached = session.cached(cacheKey); if (S.eq(tokenValue, cached)) { throw Conflict.get(); } session.cacheFor1Min(cacheKey, tokenValue); }