/* Automatically generated.
 * Copyright (c) 2000-2006 by SAP AG, Walldorf.,
 * http://www.sap.com
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of SAP AG, Walldorf. You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms
 * of the license agreement you entered into with SAP.
 * Do not edit.
 */

import ro.emid.callcenter.services.SAPService;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public class JEE_jsp_sapdebug_1759174679809 extends com.sap.engine.services.servlets_jsp.lib.jspruntime.JspBase{

	public void _jspService(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
	{
		//isXml=false
		JspFactory  _jspFactory     = JspFactory.getDefaultFactory();
		PageContext pageContext = _jspFactory.getPageContext(this,request,response,null,true,32768,true);
		ServletConfig config = pageContext.getServletConfig();
		ServletContext application = pageContext.getServletContext();
		com.sap.engine.services.servlets_jsp.lib.jspruntime.PageContextImpl _jspx_pageContext = (com.sap.engine.services.servlets_jsp.lib.jspruntime.PageContextImpl) pageContext;
		com.sap.engine.services.servlets_jsp.server.application.InjectionWrapper _jspx_resourceInjector = ((com.sap.engine.services.servlets_jsp.server.application.ServletContextImpl)_jspx_pageContext.getServletContext()).getApplicationContext().getInjectionWrapper();
		HttpSession session = pageContext.getSession();
		if (!response.isCommitted()) {
		response.setContentType("text/html; charset=UTF-8");
		}
		JspWriter   out     = pageContext.getOut();
		java.lang.Object page = this;
		try {
// HTML // begin [file="D:/usr/sap/QOR/J00/j2ee/cluster/apps/JavaEE/emid-callcenter/servlet_jsp/emid-callcenter/root/sapdebug.jsp";from=(1,86);to=(2,0)]
// end
// HTML // begin [file="D:/usr/sap/QOR/J00/j2ee/cluster/apps/JavaEE/emid-callcenter/servlet_jsp/emid-callcenter/root/sapdebug.jsp";from=(2,59);to=(13,60)]
			out.print("\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n    <title>Debug SAP \u2013 adresa reclamatie</title>\r\n</head>\r\n<body>\r\n    <h2>Debug SAP Search</h2>\r\n\r\n    <form method=\"get\">\r\n        <label for=\"adresa\">Adresa:</label>\r\n        <input type=\"text\" id=\"adresa\" name=\"adresa\" value=\"");
// end
// begin [file="D:/usr/sap/QOR/J00/j2ee/cluster/apps/JavaEE/emid-callcenter/servlet_jsp/emid-callcenter/root/sapdebug.jsp";from=(13,60);to=(13,143)]
			out.print(request.getParameter("adresa") != null ? request.getParameter("adresa") : "");
// end
// HTML // begin [file="D:/usr/sap/QOR/J00/j2ee/cluster/apps/JavaEE/emid-callcenter/servlet_jsp/emid-callcenter/root/sapdebug.jsp";from=(13,143);to=(20,4)]
			out.print("\" size=\"60\">\r\n        <input type=\"submit\" value=\"Caut\u0103 \356n SAP\">\r\n    </form>\r\n\r\n    <hr>\r\n    <h3>Rezultat interogare</h3>\r\n    <pre>\r\n    ");
// end
// begin [file="D:/usr/sap/QOR/J00/j2ee/cluster/apps/JavaEE/emid-callcenter/servlet_jsp/emid-callcenter/root/sapdebug.jsp";from=(20,4);to=(38,6)]
			
        String adresa = request.getParameter("adresa");
        if (adresa != null && !adresa.trim().isEmpty()) {
            out.println("Adresa primită: " + adresa + "\n");

            try {
                // aici apelezi clasa ta care știe să interogheze SAP
                // exemplu generic – adaptează la numele corect al clasei/metodei
                SAPService sap = new SAPService();
                String rezultat = sap.getConsultareClient(adresa);

                out.println("Rezultat SAP:\n" + rezultat);
            } catch (Exception e) {
                e.printStackTrace(new java.io.PrintWriter(out));
            }
        } else {
            out.println("Introduceți o adresă și apăsați Caută.");
        }
    
// end
// HTML // begin [file="D:/usr/sap/QOR/J00/j2ee/cluster/apps/JavaEE/emid-callcenter/servlet_jsp/emid-callcenter/root/sapdebug.jsp";from=(38,6);to=(42,0)]
			out.print("\r\n    </pre>\r\n</body>\r\n</html>\r\n");
// end
		} catch (ThreadDeath tde) { throw tde;
		} catch (OutOfMemoryError ome) { throw ome;
		} catch (Throwable t) {
			if (!(t instanceof SkipPageException)) {
				try {
					out.clear();
				} catch(java.io.IOException _jspioex) {}
				_jspx_pageContext.handlePageException(t);
			}
		}finally{
			_jspFactory.releasePageContext(pageContext);
		}
	}

}
