1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
public class ActionInitQueryOnDemand extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
ActionErrors errors = new ActionErrors();
ActionForward forward = new ActionForward(); // return value
FormInitQueryOnDemand formQueryOnDemand = (FormInitQueryOnDemand) form;
try {
// do something here
} catch (Exception e) {
// Report the error using the appropriate name and ID.
errors.add("name", new ActionError("id"));
}
// If a message is required, save the specified key(s)
// into the request for use by the <struts:errors> tag.
if (!errors.isEmpty()) {
saveErrors(request, errors);
// Forward control to the appropriate 'failure' URI (change name as desired)
// forward = mapping.findForward("failure");
} else {
// Forward control to the appropriate 'success' URI (change name as desired)
// forward = mapping.findForward("success");
}
// Finish with
// METTRE CE CODE DANS ACTION QUERY ON DEMAND 2 ?
/*HttpSession session = request.getSession(true);
QueryOnDemand query = (QueryOnDemand) request.getSession().getAttribute("QueryOnD");
if (query == null)
{
query = new QueryOnDemand();
System.out.println("création objet QueryOnD");
} else System.out.println("objet QueryOnD récupéré");
query.initWhere(request.getParameter("eventMessageId"), request.getParameter("eventFlowType"), request.getParameter("eventUserID"), request.getParameter("eventMsgType"), request.getParameter("eventCorrelationID"), request.getParameter("eventReplyToQ"),request.getParameter("eventReplyToQMgr"),request.getParameter("eventSourceQueue"),request.getParameter("eventPutAppName"),
request.getParameter("timeStmpQuery"),request.getParameter("day1"),request.getParameter("day2"),request.getParameter("eventTRS"),request.getParameter("appCode"),request.getParameter("eventType"),request.getParameter("eventSeverity"), request.getParameter("eventBrokerName"),request.getParameter("exceptMessageID"),request.getParameter("exceptLabelName"),request.getParameter("exceptReason"),request.getParameter("exceptMsgSet"),request.getParameter("exceptNLSNumber"), request.getParameter("environment"));
session.setAttribute("QueryOnD",query);
System.out.println("QueryOnDemand : Action");*/
//if (request.getParameter("action").equals("init"))
return (mapping.findForward("success"));
//else return (mapping.findForward("suite"));
}
} |