You can achieve this by using token feature in Struts:
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws Exception {
ActionMessages errors = new ActionMessages();
if (!isTokenValid(request)) {
errors.add("error.duplicaterequest", new ActionMessage("error.duplicaterequest"));
}
resetToken(request);
if (!errors.isEmpty()) {
saveErrors(request, errors);
saveToken(request);
return (mapping.getInputForward());
}
return mapping.findForward("success");
}