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
|
public class ServletRappelEx extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException, ClassNotFoundException, SQLException {
response.setContentType("application/xml");
try (PrintWriter out = response.getWriter()) {
out.println("<?xml version=\"1.0\"?>");
out.println("<rappelE>");
String restrict = request.getSession().getAttribute("restriction").toString();
String eh_ession = "";
String mois = request.getParameter("mois");
String annee = request.getParameter("annee");
if (request.getSession().getAttribute("eh_session") != null) {
eh_ession = request.getSession().getAttribute("eh_session").toString();
}
if (request.getSession().getAttribute("code_eh_choisie") != null) {
eh_ession = request.getSession().getAttribute("code_eh_choisie").toString();
}
Md_bd_O c = new Md_bd_O();
ArrayList<VR> l = c.liste_agent_rappel_e(eh_ession, restrict, mois, annee);
for (VR l_attribut : l) {
out.println("<a>" + l_attribut.getMatCAgent());
out.println("<nom_agent_rappelE>" + l_attribut.getNomAgent() + "</nom_agent_rappelE>");
out.println("<prenom_agent_rappelE>" + l_attribut.getPrenomAgent() + "</prenom_agent_rappelE>");
out.println("<code_agent_rappelE>" + l_attribut.getCruCRubrique() + "</code_agent_rappelE>");
out.println("<lib_agent_rappelE>" + l_attribut.getLibellecrucrubrique() + "</lib_agent_rappelE>");
out.println("<motif_agent_rappelE>" + l_attribut.getHprCMotif() + "</motif_agent_rappelE>");
out.println("<net_agent_rappelE>" + l_attribut.getHprMMontant() + "</net_agent_rappelE>");
out.println("</a>");
}
out.println("</rappelE>");
}
} |