Return from a servlet

Is it possible to return from servlet?
I have a servlet where i catch exceptions.To display the error messages i call a function from the service method which outputs the error string to the response in a html page.After the error has been displayed i want the servlet to return.Can i do it ?
eg
service(..,..)
on error call displayerror(errorstring);
??? now how do i just stop processing ????
displayerror(String errstr)
print the errstr in a html page

The doGet and doPost in a servlet are standard Java Methods:
public void doGet
and
public void doPost
so you can return from them just as you would from any void method. Just do not return a value.
ie:
return;
will cause the program thread to return to where the method was called from.

Similar Messages

  • Want to display from database but javaclas not returning values to servlets

    I am trying to view values stored in database using jsp, servlets and java class. Jsp is calling servlet and servlet calls java class file. and javaclass file retrieves data from database and sends it back to servlet. But my problem is servlet doesnt print the values.
    Here is my code
    This is the javaclass file.
    package pack;
    import java.util.*;
    import java.sql.Driver.*;
    import java.sql.Connection.*;
    import java.sql.*;
    import java.sql.DriverManager.*;
    import java.sql.SQLException.*;
    import java.io.*;
    import java.io.Serializable;
    import java.util.Vector;
    import pack.ser1;
    /* Control is got from the servlet file */
    public class employbean implements Serializable
      public Vector result;
      public Vector getResult() throws ClassNotFoundException, InstantiationException, IllegalAccessException
                /* Connection is established to retrieve data from the database */
                Vector v = new Vector();
                ResultSet rs = null;
                PreparedStatement st = null;
                try
                 Class.forName("org.gjt.mm.mysql.Driver").newInstance();
                 Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/sample?user=user&password=password");
                  st = connection.prepareStatement("Select * from samp");
                  rs = st.executeQuery();
                  while(rs.next())
                      v.addElement(rs.getString("empid"));
                  st.close();
                  connection.close();
                 catch(SQLException esql)
                      esql.printStackTrace();
                  this.result = v;
                 /* Control is sent back to the servlet */
                 return result;
    }Here is the servlet code.
    package pack;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import pack.employbean;
    import java.util.Enumeration;
    import java.util.Vector;
    import pack.*;
    public class ser1 extends HttpServlet
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException, InstantiationException, IllegalAccessException, ClassNotFoundException
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            try
              employbean ebean = new employbean();
              Vector v = ebean.getResult();
              Enumeration en = v.elements();
              while(en.hasMoreElements())
                out.println("employee id= "+ en.nextElement());
              out.println("employid"+employid);
             catch(Exception m)
               out.println(m);
             out.close();
            // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
        /** Handles the HTTP <code>GET</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
        /** Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
        /** Returns a short description of the servlet.
        public String getServletInfo()
            return "Short description";
    }Please help me with my code as where i might have gone wrong and help me rectifying the errors.
    I also would like to know if this is MVC pattern.
    Thanks in Advance

    Try this one
    package pack;
    import java.util.*;
    import java.sql.Driver.*;
    import java.sql.Connection.*;
    import java.sql.*;
    import java.sql.DriverManager.*;
    import java.sql.SQLException.*;
    import java.io.*;
    import java.io.Serializable;
    import java.util.Vector;
    import pack.ser1;
    /* Control is got from the servlet file */
    public class employbean implements Serializable
    public Vector result;
    public Vector getResult() throws Exception
    /* Connection is established to retrieve data from the database */
    Vector v = new Vector();
    ResultSet rs = null;
    PreparedStatement st = null;
    try
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/sample?user=user&password=password");
    st = connection.prepareStatement("Select * from samp");
    rs = st.executeQuery();
    while(rs.next())
    v.addElement(rs.getString("empid"));
    st.close();
    connection.close();
    catch(SQLException esql)
         throw e;
    this.result = v;
    /* Control is sent back to the servlet */
    return result;
    Here is the servlet code.
    package pack;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import pack.employbean;
    import java.util.Enumeration;
    import java.util.Vector;
    import pack.*;
    public class ser1 extends HttpServlet
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException, InstantiationException, IllegalAccessException, ClassNotFoundException
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();
    try
    employbean ebean = new employbean();
    Vector v = ebean.getResult();
    Enumeration en = v.elements();
    while(en.hasMoreElements())
    out.println("employee id= "+ en.nextElement());
    // out.println("employid"+employid);
    catch(Exception m)
    out.println(m);
    out.close();
    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /** Handles the HTTP <code>GET</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    try
    processRequest(request,response);
    catch(Exception e)
    /** Handles the HTTP <code>POST</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    try
    processRequest(request,response);
    catch(Exception e)
    /** Returns a short description of the servlet.
    public String getServletInfo()
    return "Short description";
    Send me the output

  • Want to display from database but javaclass not returning values to servlet

    I am trying to view values stored in database using jsp, servlets and java class. Jsp is calling servlet and servlet calls java class file. and javaclass file retrieves data from database and sends it back to servlet. But my problem is javaclass file doesnt return the value to servlet and print. Here is my code
    This is the javaclass file.
    package pack;
    import java.util.*;
    import java.sql.Driver.*;
    import java.sql.Connection.*;
    import java.sql.*;
    import java.sql.DriverManager.*;
    import java.sql.SQLException.*;
    import java.io.*;
    import java.io.Serializable;
    import java.util.Vector;
    import pack.ser1;
    /* Control is got from the servlet file */
    public class employbean implements Serializable
      public Vector result;
      public Vector getResult() throws ClassNotFoundException, InstantiationException, IllegalAccessException
                /* Connection is established to retrieve data from the database */
                Vector v = new Vector();
                ResultSet rs = null;
                PreparedStatement st = null;
                try
                 Class.forName("org.gjt.mm.mysql.Driver").newInstance();
                 Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/sample?user=user&password=password");
                  st = connection.prepareStatement("Select * from samp");
                  rs = st.executeQuery();
                  while(rs.next())
                      v.addElement(rs.getString("empid"));
                  st.close();
                  connection.close();
                 catch(SQLException esql)
                      esql.printStackTrace();
                  this.result = v;
                 /* Control is sent back to the servlet */
                 return result;
    }Here is the servlet code.
    package pack;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import pack.employbean;
    import java.util.Enumeration;
    import java.util.Vector;
    import pack.*;
    public class ser1 extends HttpServlet
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException, InstantiationException, IllegalAccessException, ClassNotFoundException
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            try
              employbean ebean = new employbean();
              Vector v = ebean.getResult();
              Enumeration en = v.elements();
              while(en.hasMoreElements())
                out.println("employee id= "+ en.nextElement());
              out.println("employid"+employid);
             catch(Exception m)
               out.println(m);
             out.close();
            // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
        /** Handles the HTTP <code>GET</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
        /** Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
        /** Returns a short description of the servlet.
        public String getServletInfo()
            return "Short description";
    }Please help me with my code as where i might have gone wrong and help me rectifying the errors.
    I also would like to know if this is MVC pattern.
    Thanks in Advance

    I am trying to view values stored in database using jsp, servlets and java class. Jsp is calling servlet and servlet calls java class file. and javaclass file retrieves data from database and sends it back to servlet. But my problem is javaclass file doesnt return the value to servlet and print. Here is my code
    This is the javaclass file.
    package pack;
    import java.util.*;
    import java.sql.Driver.*;
    import java.sql.Connection.*;
    import java.sql.*;
    import java.sql.DriverManager.*;
    import java.sql.SQLException.*;
    import java.io.*;
    import java.io.Serializable;
    import java.util.Vector;
    import pack.ser1;
    /* Control is got from the servlet file */
    public class employbean implements Serializable
      public Vector result;
      public Vector getResult() throws ClassNotFoundException, InstantiationException, IllegalAccessException
                /* Connection is established to retrieve data from the database */
                Vector v = new Vector();
                ResultSet rs = null;
                PreparedStatement st = null;
                try
                 Class.forName("org.gjt.mm.mysql.Driver").newInstance();
                 Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/sample?user=user&password=password");
                  st = connection.prepareStatement("Select * from samp");
                  rs = st.executeQuery();
                  while(rs.next())
                      v.addElement(rs.getString("empid"));
                  st.close();
                  connection.close();
                 catch(SQLException esql)
                      esql.printStackTrace();
                  this.result = v;
                 /* Control is sent back to the servlet */
                 return result;
    }Here is the servlet code.
    package pack;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import pack.employbean;
    import java.util.Enumeration;
    import java.util.Vector;
    import pack.*;
    public class ser1 extends HttpServlet
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException, InstantiationException, IllegalAccessException, ClassNotFoundException
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            try
              employbean ebean = new employbean();
              Vector v = ebean.getResult();
              Enumeration en = v.elements();
              while(en.hasMoreElements())
                out.println("employee id= "+ en.nextElement());
              out.println("employid"+employid);
             catch(Exception m)
               out.println(m);
             out.close();
            // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
        /** Handles the HTTP <code>GET</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
        /** Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
        /** Returns a short description of the servlet.
        public String getServletInfo()
            return "Short description";
    }Please help me with my code as where i might have gone wrong and help me rectifying the errors.
    I also would like to know if this is MVC pattern.
    Thanks in Advance

  • Returning multiple parameters as response from a servlet

    Hii Javaites
    I want a servlet to return multiple parameters as response.
    In my functionality , i am callling the servlet from a swing client .
    I need to get two xml strings as response from the servlet.
    Right now i am using
    PrintWriter pw=response.getWriter();
    pw.write(xmlString);
    for writing xml string . but wht if i want to send another String (xmlString2) as resposne from the servlet to the swing application ?

    You have several possibilities. If you control the XML formats you could unify the data into one XML message. You could modify your Swing app to make two requests. If it needs two separate pieces of info it is more logical to do it as two separate requests. If you really must do it this way, you could use the Zip classes (built in to Java) to put the two XML files together into a Zip file and then send that.

  • Return data from Java servlet in form of JSON encoded parameters in Javascr

    How to return data from Java servlet in form of JSON encoded parameters in Javascript handler function call?
    The same is implemented in php as the following
    echo "sT.handleAjaxResponse(";
    echo json_encode($response);
    echo ");";
    How to do the same in Java servlet?
    Thanks.

    With the rising popularity of JSON (especially with Ajax), support for it has started to appear in the Java community. I am not aware of any standardized approach yet, but expect it is likely we'll see that eventually. For now, you probably want to look at a third-party library such as the [JSON in Java Library|http://www.json.org/java/], Jettison, or [Java Tools for the JSON Format|http://jsontools.berlios.de/].

  • How to call a specific method in a servlet from another servlet

    Hi peeps, this post is kinda linked to my other thread but more direct !!
    I need to call a method from another servlet and retrieve info/objects from that method and manipulate them in the originating servlet .... how can I do it ?
    Assume the originating servlet is called Control and the servlet/method I want to access is DAO/login.
    I can create an object of the DAO class, say newDAO, and access the login method by newDAO.login(username, password). Then how do I get the returned info from the DAO ??
    Can I use the RequestDispatcher to INCLUDE the call to the DAO class method "login" ???
    Cheers
    Kevin

    Thanks for the reply.
    So if I have a method in my DAO class called login() and I want to call it from my control servlet, what would the syntax be ?
    getrequestdispatcher.include(newDAO.login())
    where newDAO is an instance of the class DAO, would that be correct ?? I'd simply pass the request object as a parameter in the login method and to retrieve the results of login() the requestdispatcher.include method will return whatever I set as an attribute to the request object, do I have that right ?!!!!
    Kevin

  • How to get the value from a servlet?

    Hello guys:
    how can i get the value from a servlet on my jsp page,for example return a boolean variable from a servlet
    which API to use?
    thanks

    Hi
    There is no specific API for this, call the method of the servlet which returns the required value in your JSP page.
    Thanks
    Swaraj

  • Sending an email from a servlet

    Hi Guys,
    Im trying to send an email from a servlet. I am using the following code:
    IMPORTING LIBRARIES
    import java.util.*;
    import java.io.*;
    import javax.servlet.http.*;
    import javax.servlet.*;
    //importing JDBC
    import java.sql.*;
    //email
    import java.net.*;
    import java.text.*; // Used for date formatting.
    BEGIN CLASS
    public class Email3 extends HttpServlet
         private Socket smtpSocket = null;
         private DataOutputStream os = null;
         private DataInputStream is = null;
    public void doPost (HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    PrintWriter out = res.getWriter();
    OUTPUT TAGS FOR WEBPAGE
         out.println("<html>");
    out.println("<head>");
    out.println("<title>FYP</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<center>");
    send email
              //Date dDate = new Date();
              //DateFormat dFormat = _
         //DateFormat.getDateInstance(DateFormat.FULL,Locale.US);
         String m_sHostName="localhost";
         int m_iPort=25;
              try
              { // Open port to server
                   smtpSocket = new Socket(m_sHostName, m_iPort);
                   os = new DataOutputStream(smtpSocket.getOutputStream());
                   is = new DataInputStream(smtpSocket.getInputStream());
                   if(smtpSocket != null && os != null && is != null)
                   { // Connection was made.  Socket is ready for use.
                        out.println("Connection was made. Socket is ready for use.");
                        //[ Code to send email will be placed in here. ]
                        try
                             {   os.writeBytes("HELLO\r\n");
                             // You will add the email address that the server
                             // you are using know you as.
                             os.writeBytes("MAIL From: <[email protected]>\r\n");
                             // Who the email is going to.
                             os.writeBytes("RCPT To: <[email protected]>\r\n");
                             //IF you want to send a CC then you will have to add this
                             os.writeBytes("RCPT Cc: <[email protected]>\r\n");
                             // Now we are ready to add the message and the
                             // header of the email to be sent out.
                             os.writeBytes("DATA\r\n");
                             os.writeBytes("X-Mailer: Via Java\r\n");
                             //os.writeBytes("DATE: " + dFormat.format(dDate) + "\r\n");
                             os.writeBytes("From: Me <[email protected]>\r\n");
                             os.writeBytes("To: YOU <[email protected]>\r\n");
                             //Again if you want to send a CC then add this.
                             os.writeBytes("Cc: CCDUDE <[email protected]>\r\n");
                             //Here you can now add a BCC to the message as well
                             //os.writeBytes("RCPT Bcc: BCCDude<[email protected]>\r\n");
                             String sMessage = "Your subjectline.";
                             os.writeBytes("Subject: Your subjectline here\r\n");
                             os.writeBytes(sMessage + "\r\n");
                             os.writeBytes("\r\n.\r\n");
                             os.writeBytes("QUIT\r\n");
                             // Now send the email off and check the server reply.
                             // Was an OK is reached you are complete.
                             String responseline;
                             while((responseline = is.readLine())!=null)
                             {  // System.out.println(responseline);
                             out.println("responseline= "+responseline+"<br>");
                             if(responseline.indexOf("Ok") != -1)
                                  //out.println("responseline"+responseline);
                             break;
                             catch(Exception e)
                             {  System.out.println("Cannot send email as an error occurred.");
                                  out.println("Cannot send email as an error occurred.");
              catch(Exception e)
              { System.out.println("Host " + m_sHostName + "unknown"); }
              out.println("</center>");
              out.println("</body>");
              out.println("</html>");
              out.close();
    }//end class
    it compiles fine, the connection was made ok but im not receiving the email. When the email is sent off the server reply does not seem to be Ok, as the print statement i tried there is not being executed. When i print the content of my responseline= variable before the if statement i get the following:
    Connection was made. Socket is ready for use. responseline= 220 centaur.elec.qmul.ac.uk ESMTP Exim 3.16 #2 Thu, 09 Jan 2003 15:54:34 +0000
    responseline= 500 Command unrecognized
    responseline= 250 is syntactically correct
    responseline= 550 relaying to prohibited by administrator
    responseline= 500 Command unrecognized
    responseline= 503 No recipient(s).
    responseline= 500 Command unrecognized
    responseline= 500 Command unrecognized
    responseline= 500 Command unrecognized
    responseline= 500 Command unrecognized
    responseline= 500 Command unrecognized
    responseline= 500 Command unrecognized
    responseline= 500 Command unrecognized
    responseline= 500 Command unrecognized
    responseline= 221 Closing connection. Good bye.
    Can anyone help?
    Is there an easier way to send an email from a servlet?
    Thanks
    tzaf

    It's not a matter of "easier way" to send mail from servlet...you are missing a crucial element in your code: authorization to send mail. You need something like this (some of which you have already so note what is different):
            Properties properties = new Properties();
            properties.put("mail.smtp.host", String3 );
            properties.put("mail.smtp.dsn.notify", "SUCCESS" );
            properties.put("mail.smtp.host", "mailservernamegoeshere");
            properties.put("mail.smtp.auth", "true");
            MyAuthenticator auth = new MyAuthenticator();
            auth.setUser("user whos account you want to use goes here");
            auth.setPassword("user password goes here");
            Session session = Session.getDefaultInstance( properties,auth );Here is the auth class:
    class MyAuthenticator extends Authenticator {
       protected String m_strUser     = null;
       protected String m_strPassword = null;
       protected PasswordAuthentication getPasswordAuthentication()  {
          return new PasswordAuthentication(m_strUser,m_strPassword);
       public void setUser(String strUser)  {
          m_strUser = strUser;
       public void setPassword(String strPassword)  {
          m_strPassword = strPassword;

  • A SOA Exception returned from Oracle EBS ISG

    Hi All,
    Need your help. Maybe someone know the solution for this error.
    Background
    Using a webservice client to call WSDL service which is published in Oracle EBS Integrated SOA Gateway. After invoking, encounter a error.
    Error
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><faultcode xmlns="">SOAP-ENV:Server</faultcode><faultstring xmlns="">FND_SOA_SERVICE_EXECUTION_ERR:oracle.apps.fnd.soa.util.SOAException: ServiceExecutionError: Error while executing the service Exception returned from JCA Service Runtime. Exception returned from JCA Service Runtime. null
        :Please see service monitor logs for full error trace</faultstring></env:Fault></env:Body></env:Envelope>
    My Research
    I checked SOA log, found detailed log like below.
    Fri Aug 23 19:19:04 CST 2013 : oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke : JCAClientFactoryCrated.
    Fri Aug 23 19:19:04 CST 2013 : oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke : JCAInterfaceCreated.
    Fri Aug 23 19:19:04 CST 2013 : oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke : JCAOperationCreated.
    Fri Aug 23 19:19:04 CST 2013 : oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke : buildversion in jcahanlder is 1213
    Fri Aug 23 19:19:04 CST 2013 : oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke : found runtime classes
    Fri Aug 23 19:19:04 CST 2013 : oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke : created instance for runtime classes
    Fri Aug 23 19:19:04 CST 2013 : oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke : runtime Methods found [Ljava.lang.reflect.Method;@2ba02ba0
    Fri Aug 23 19:19:04 CST 2013 : oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke : method executeRequestResponseOperation found
    Fri Aug 23 19:19:04 CST 2013 : oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke : executing 3 parameter method
    Fri Aug 23 19:19:05 CST 2013 : oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke : Exception returned from JCA Service Runtime.java.lang.reflect.InvocationTargetException
    Fri Aug 23 19:19:05 CST 2013 : oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke : Exception returned from JCA Service Runtime.oracle.apps.fnd.soa.util.SOAException: ServiceProcessingError: Exception returned from JCA Service Runtime. null
    Fri Aug 23 19:19:05 CST 2013 : oracle.apps.fnd.soa.provider.services.jca.JCAHandler.handleRequest : Exception returned from JCA Service Runtime.oracle.apps.fnd.soa.util.SOAException: ServiceProcessingError: Exception returned from JCA Service Runtime. Exception returned from JCA Service Runtime. null
    Fri Aug 23 19:19:05 CST 2013 : oracle.apps.fnd.soa.provider.SOAProvider.createErrorResponseMessage : Creating Error Response Message.
    Fri Aug 23 19:19:05 CST 2013 : oracle.apps.fnd.soa.provider.SOAProvider.getNLSTranslatedMessage : Error code : FND_SOA_SERVICE_EXECUTION_ERR
    Fri Aug 23 19:19:05 CST 2013 : oracle.apps.fnd.soa.util.SOAContext.setSecurityContext : Is security context set = true
    Fri Aug 23 19:19:05 CST 2013 : oracle.apps.fnd.soa.util.SOAContext.setNLSContext : Is nls context set = true
    Fri Aug 23 19:19:05 CST 2013 : oracle.apps.fnd.soa.provider.SOAProvider.getNLSTranslatedMessage : NLS Compliant Error Msg = FND_SOA_SERVICE_EXECUTION_ERR
    Fri Aug 23 19:19:05 CST 2013 : oracle.apps.fnd.soa.provider.SOAProvider.createErrorResponseMessage : Setting fault string = FND_SOA_SERVICE_EXECUTION_ERR:oracle.apps.fnd.soa.util.SOAException: ServiceExecutionError: Error while executing the service Exception returned from JCA Service Runtime. Exception returned from JCA Service Runtime. null
        :Please see service monitor logs for full error trace
    Fri Aug 23 19:19:05 CST 2013 : oracle.apps.fnd.soa.provider.SOAProvider.createErrorResponseMessage : Error Response Message Created
    Fri Aug 23 19:19:05 CST 2013 : oracle.apps.fnd.soa.provider.SOAProvider.processMessage : oracle.apps.fnd.soa.util.SOAException: ServiceExecutionError: Error while executing the service Exception returned from JCA Service Runtime. Exception returned from JCA Service Runtime. null
        at oracle.apps.fnd.soa.provider.services.jca.JCAHandler.handleRequest(JCAHandler.java:135)
        at oracle.apps.fnd.soa.provider.SOAProvider.processMessage(SOAProvider.java:366)
        at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:958)
        at oracle.j2ee.ws.server.WebServiceProcessor$1.run(WebServiceProcessor.java:388)
        at java.security.AccessController.doPrivileged(AccessController.java:284)
        at javax.security.auth.Subject.doAs(Subject.java:573)
        at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:385)
        at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:481)
        at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:114)
        at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:96)
        at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:200)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:734)
        at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
        at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908)
        at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
        at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
        at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
        at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
        at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
        at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
        at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
        at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
        at java.lang.Thread.run(Thread.java:735)
    java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:599)
        at oracle.apps.fnd.soa.provider.services.jca.JCAHandler.invoke(JCAHandler.java:193)
        at oracle.apps.fnd.soa.provider.services.jca.JCAHandler.handleRequest(JCAHandler.java:123)
        at oracle.apps.fnd.soa.provider.SOAProvider.processMessage(SOAProvider.java:366)
        at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:958)
        at oracle.j2ee.ws.server.WebServiceProcessor$1.run(WebServiceProcessor.java:388)
        at java.security.AccessController.doPrivileged(AccessController.java:284)
        at javax.security.auth.Subject.doAs(Subject.java:573)
        at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:385)
        at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:481)
        at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:114)
        at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:96)
        at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:200)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:734)
        at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
        at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908)
        at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
        at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
        at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
        at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
        at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
        at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
        at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
        at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
        at java.lang.Thread.run(Thread.java:735)
    Caused by: org.collaxa.thirdparty.apache.wsif.WSIFException: file:/xxxx/soa/PLSQL/4392/INVOKEFMSWS.wsdl [ INVOKEFMSWS_ptt::INVOKEFMSWS(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'INVOKEFMSWS' failed due to: Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    ; nested exception is:
        ORABPEL-11622
    Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    See root exception for the specific exception. You may need to configure the connection settings in the deployment descriptor (i.e. $J2EE_HOME/application-deployments/default/DbAdapter/oc4j-ra.xml) and restart the server. Caused by javax.resource.spi.InvalidPropertyException: Missing Property Exception.
    Missing Property: [DBManagedConnectionFactory.userName].
    Make sure the property is set in the interaction (activation) spec by editing its definition in the wsdl.
        at oracle.tip.adapter.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation(WSIFOperation_JCA.java:642)
        at oracle.tip.adapter.client.JCABindingOperation.invokeWsifProvider(JCABindingOperation.java:275)
        at oracle.tip.adapter.client.JCABindingOperation.executeRequestResponseOperation(JCABindingOperation.java:182)
        ... 30 more
    Caused by: ORABPEL-11622
    Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    See root exception for the specific exception. You may need to configure the connection settings in the deployment descriptor (i.e. $J2EE_HOME/application-deployments/default/DbAdapter/oc4j-ra.xml) and restart the server. Caused by javax.resource.spi.InvalidPropertyException: Missing Property Exception.
    Missing Property: [DBManagedConnectionFactory.userName].
    Make sure the property is set in the interaction (activation) spec by editing its definition in the wsdl.
    And in MOS, I found below related metalink note, But I think my case is not same with the description in that note, bcz the reponsibility I provided is not null, and should be a correct value.
    FND_SOA_SERVICE_EXECUTION_ERR Error When Invoking EBS SOA Gateway Web Service (Doc ID 1512956.1)
    Thanks in advance
    Paul

    Hi, PaulTian ,
      Have you find the solution? I have the same problem, and it world not be responsibility reasons. The webservice worked well ,but it stopped when applied a patch.
    Kevin

  • I want to send a response from the servlet and then call another servlet.

    Hi,
    I want to send a response from the servlet and then call another servlet. can this happen. Here is my scenario.
    1. Capture all the information from a form including an Email address and submit it to a servlet.
    2. Now send a message to the browser that the request will be processed and mailed.
    3. Now execute the request and give a mail to the mentioned Email.
    Can this be done in any way even by calling another servlet from within a servlet or any other way.
    Can any one Please help me out.
    Thanks,
    Ramesh

    Maybe that will help you (This is registration sample):
    1.You have Registration.html;
    2.You have Registration servlet;
    3.You have CheckUser servlet;
    4.And last you have Dispatcher between all.
    See the code:
    Registration.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
      <HEAD>
        <TITLE>Hello registration</TITLE>
      </HEAD>
      <BODY>
      <H1>Entry</H1>
    <FORM ACTION="helloservlet" METHOD="POST">
    <LEFT>
    User: <INPUT TYPE="TEXT" NAME="login" SIZE=10><BR>
    Password: <INPUT TYPE="PASSWORD" NAME="password" SIZE=10><BR>
    <P>
    <TABLE CELLSPACING=1>
    <TR>
    <TH><SMALL>
    <INPUT TYPE="SUBMIT" NAME="logon" VALUE="Entry">
    </SMALL>
    <TH><SMALL>
    <INPUT TYPE="SUBMIT" NAME="registration" VALUE="Registration">
    </SMALL>
    </TABLE>
    </LEFT>
    </FORM>
    <BR>
      </BODY>
    </HTML>
    Dispatcher.java
    package mybeans;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletException;
    import java.io.IOException;
    import javax.servlet.RequestDispatcher;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Dispatcher extends HttpServlet {
        protected void forward(String address, HttpServletRequest request,
                               HttpServletResponse response)
                               throws ServletException, IOException {
                                   RequestDispatcher dispatcher = getServletContext().
                                   getRequestDispatcher(address);
                                   dispatcher.forward(request, response);
    Registration.java
    package mybeans;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Registration extends Dispatcher {
        public String getServletInfo() {
            return "Registration servlet";
        public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            ServletContext ctx = getServletContext();
            if(request.getParameter("logon") != null) {          
                this.forward("/CheckUser", request, response);
            else if (request.getParameter("registration") != null)  {         
                this.forward("/registration.html", request, response);
    CheckUser.java
    package mybeans;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class CheckUser extends Dispatcher {
        Connection conn;
        Statement stat;
        ResultSet rs;
          String cur_UserName;
        public static String cur_UserSurname;;
        String cur_UserOtchestvo;
        public String getServletInfo() {
            return "Registration servlet";
        public void service(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            try{
                ServletContext ctx = getServletContext();
                Class.forName("oracle.jdbc.driver.OracleDriver");
                conn = DriverManager.getConnection("jdbc:oracle:oci:@eugenz","SYSTEM", "manager");
                stat = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
               String queryDB = "SELECT ID, Login, Password FROM TLogon WHERE Login = ? AND Password = ?";
                PreparedStatement ps = conn.prepareStatement(queryDB); 
               User user = new User();
            user.setLogin(request.getParameter("login"));
            String cur_Login = user.getLogin();
            ps.setString(1, cur_Login);
            user.setPassword(request.getParameter("password"));
            String cur_Password = user.getPassword();
            ps.setString(2, cur_Password);
         Password = admin");
            rs = ps.executeQuery();
                 String sn = "Zatoka";
            String n = "Eugen";
            String queryPeople = "SELECT ID, Surname FROM People WHERE ID = ?";
           PreparedStatement psPeople = conn.prepareStatement(queryPeople);
                      if(rs.next()) {
                int logonID = rs.getInt("ID");
                psPeople.setInt(1, logonID);
                rs = psPeople.executeQuery();
                rs.next();
                       user.setSurname(rs.getString("Surname"));
              FROM TLogon, People WHERE TLogon.ID = People.ID";
                       ctx.setAttribute("user", user);
                this.forward("/successLogin.jsp", request, response);
            this.forward("/registration.html", request, response);
            catch(Exception exception) {
    }CheckUser.java maybe incorrect, but it's not serious, because see the principe (conception).
    Main is Dispatcher.java. This class is dispatcher between all servlets.

  • How to write from a servlet to it's war file?

    We need to be able to write a file from a servlet into the document root
              area to it can be accessed by a browser. Before we used war files, we
              would simply figure out the real document root directory and write the
              file somewhere under it. How would I do this when my application is
              packaged as a war? I don't see a way to write to a "xxx.war" file and
              if we run from an exploded war, how do I determine the location of the
              document root at runtime from the servlet? I don't want to have to hard
              code the path or make each installation specifiy it in a properties
              file. It seems there should be a better way to handle this. Any ideas?
              

    Thanks for your help. Not to beat this to death but say I want a response that
              includes a bunch of HTML generated by a servlet or JSP and in the middle I want
              a dynamically created image. So basically I want an <image> tag in the middle
              of the html returned. Could I dynamically generate the image and add it to the
              response in the middle of the servlet/JSP processing? I thought the only option
              would be to return an html page the referred to an image via an <image> tag.
              What do you think?
              Kirk
              Cameron Purdy wrote:
              > Hi Kirk,
              >
              > Yes, you can accomplish all of those things without writing files out.
              > Writing files will severely degrade performance in many cases, and will lead
              > to certain classes of bugs such as those caused by multiple browsers within
              > the same process or rampant use of "back" lists. (That's a long-winded way
              > of saying persistent state on the server that reflects a client's transient
              > state has a way of being wrong, sooner or later.)
              >
              > All you have to do is return a URL that includes the necessary information
              > to get the picture. You do that now by creating a random thingamabob name:
              >
              > http://www.mysite.com/myapp/thisisarandomname12345.jpg
              >
              > Instead of random, try:
              >
              > http://www.mysite.com/myapp/thisisthepictureforemployee-17.jpg
              >
              > The issues are the same (someone trying to guess URLs) but you do have the
              > problem that the URLs are easier to guess because they follow a pattern.
              > You should secure-check each request anyway. (Lots of tricks for making
              > that very efficient, but that is a book in itself.)
              >
              > So what serves up the .jpg? A Servlet!!! It gets the request, builds (or
              > reads from db or whatever) the .jpg image and streams it out. Now you get
              > 3-4 times the performance and a much more orderly arrangement of URLs etc.
              > that can now be "saved" and "bookmarked" etc. Also no congested temp dirs
              > etc.
              >
              > Peace,
              >
              > --
              > Cameron Purdy
              > Tangosol, Inc.
              > http://www.tangosol.com
              > Tangosol Server: Enabling enterprise application customization
              >
              > "Kirk Everett" <[email protected]> wrote in message
              > news:[email protected]...
              > > What I want to do is one one servlet request generate an image file in the
              > doc
              > > root and then return a page back to the browser that contains an image tag
              > > referring to the generated image file. I also want to be able to generate
              > a file
              > > of data based on a user's posted selections and then present them with a
              > link to
              > > download the file. If I don't write these to disk in the docroot how
              > would I
              > > give the user a link to them? Is there a better way? Thanks for your
              > help.
              > >
              > > Kirk
              > >
              > > Cameron Purdy wrote:
              > >
              > > > Yes, if you have to write a file (either because you expect it to be
              > used
              > > > many times or you wish to assemble a huge (>1mb) response without using
              > > > memory), then do so to a temp or working dir. There is no reason to use
              > the
              > > > doc root at all for that, other than to use FileServlet, which is eaily
              > > > replicated for your own specific purposes. For the most part, there is
              > no
              > > > reason to write the file, since you can write the response back to the
              > > > browser just as easily as to a file.
              > > >
              > > > Peace,
              > > >
              > > > --
              > > > Cameron Purdy
              > > > Tangosol, Inc.
              > > > http://www.tangosol.com
              > > > +1.617.623.5782
              > > > WebLogic Consulting Available
              > > >
              > > > "Kirk Everett" <[email protected]> wrote in message
              > > > news:[email protected]...
              > > > > I agree that in general this should be avoided but we have two cases
              > where
              > > > we
              > > > > need to write a file to the
              > > > > the document root. The first is we allow the user to generate a file
              > and
              > > > > download it to thier machine. So in
              > > > > one servlet the user selects the data and submits the form. The
              > servlet
              > > > then
              > > > > writes a file to the docroot and
              > > > > the user is then presented a link where they can download the file.
              > The
              > > > second
              > > > > is when we want to generate
              > > > > a chart image in a gif. The servlet writes the image to the docroot
              > and
              > > > another
              > > > > JSP refers to the image in an
              > > > > image tag. In both cases we are using mangled names and we clean up
              > the
              > > > files.
              > > > > Do you have a better solution?
              > > > > Thanks for your help.
              > > > >
              > > > > Cameron Purdy wrote:
              > > > >
              > > > > > Writing to a deployed application is generally a thing to be
              > avoided.
              > > > Among
              > > > > > other things, it is a potential security issue. Apps should be able
              > to
              > > > be
              > > > > > locked down (no OS write access except non-exec temp space). I
              > suggest
              > > > not
              > > > > > doing writes if at all avoidable. What are you trying to
              > accomplish?
              > > > > > Perhaps stream back a big file?
              > > > > >
              > > > > > Peace,
              > > > > >
              > > > > > --
              > > > > > Cameron Purdy
              > > > > > Tangosol, Inc.
              > > > > > http://www.tangosol.com
              > > > > > +1.617.623.5782
              > > > > > WebLogic Consulting Available
              > > > > >
              > > > > > "Kirk Everett" <[email protected]> wrote in message
              > > > > > news:[email protected]...
              > > > > > > We need to be able to write a file from a servlet into the
              > document
              > > > root
              > > > > > > area to it can be accessed by a browser. Before we used war files,
              > we
              > > > > > > would simply figure out the real document root directory and write
              > the
              > > > > > > file somewhere under it. How would I do this when my application
              > is
              > > > > > > packaged as a war? I don't see a way to write to a "xxx.war" file
              > and
              > > > > > > if we run from an exploded war, how do I determine the location of
              > the
              > > > > > > document root at runtime from the servlet? I don't want to have
              > to
              > > > hard
              > > > > > > code the path or make each installation specifiy it in a
              > properties
              > > > > > > file. It seems there should be a better way to handle this. Any
              > > > ideas?
              > > > > > >
              > > > >
              > >
              

  • Problem in retriving the realpath from the servlet

    Hai All,
    I am facing problem in retriving the realpath from the servlet.
    I am using the following code in order to retrieve the path.
    String prefix = getServletContext().getRealPath("/WEB-INF/classes");
    The value returned from above code is null.
    I am using Weblogic 8.1 server, and deploying my servlet as WAR file inside
    the weblogic server.
    Is this the problem with the weblogic server or with the code. Is there any way to over come this.
    I need the path as i am implementing Log4j for the servlet and i have to pass the
    configuration file in one of the function "PropertyConfigurator.configure(file);"
    where the file should include complete path.
    My configuration file is in WEB-INF/Classes directory.
    Any help is appreciated.
    Thanks in advance
    Pooja.

    String realPath = request.getRealPath(request.getContextPath());
    That should return the path up to where you have your servlet context.

  • Accessing an ejb from a servlet gives resource not allowed exception

    hi friends,
    i deployed a bean in weblogic server calling from within a servlet. this bean is used to retrieve a database connection and returns to the servlet. i have done all the resource references lookups everything and also the bean is deployed successfully, but when i run the servlet i didn't get even the println messages. it gives resource not allowed message.
    here is the deployment descriptor is correct ? if anything wrong or missed, please mention and try to give me the solution.
    web.xml
    <web-app>
    <servlet>
    <servlet-name>TestConnection</servlet-name>
    <display-name>TestConnection</display-name>
    <servlet-class>tms.com.ejb.TestConnection</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>TestConnection</servlet-name>
    <url-pattern>TestConnection</url-pattern>
    </servlet-mapping>
    <resource-ref>
    <res-ref-name>tmsPool</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    <env-entry>
    <env-entry-name>tmsDataSource</env-entry-name>
    <env-entry-value>tmsPool</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
    <env-entry>
    <env-entry-name>TMS_DBConnectionBean</env-entry-name>
    <env-entry-value>java:comp/env/ejb/TMS_DBConnectionBean</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
    <ejb-ref>
    <ejb-ref-name>ejb/TMS_DBConnectionBean</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>tms.com.ejb.TMS_DBConnectionHome</home>
    <remote>tms.com.ejb.TMS_DBConnection</remote>
    <ejb-link>TMS_DBConnectionBean</ejb-link>
    </ejb-ref>
    </web-app>
    Ejb jar is
    <enterprise-beans>
    <session>
    <display-name>ConnectionBean</display-name>
    <ejb-name>TMS_DBConnectionBean</ejb-name>
    <home>tms.com.ejb.TMS_DBConnectionHome</home>
    <remote>tms.com.ejb.TMS_DBConnection</remote>
    <ejb-class>tms.com.ejb.TMS_DBConnectionBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <env-entry>
    <env-entry-name>tmsDataSource</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>tmsPool</env-entry-value>
    </env-entry>
    <security-identity>
    <description></description>
    <use-caller-identity></use-caller-identity>
    </security-identity>
    <resource-ref>
    <res-ref-name>tmsPool</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <!--<res-sharing-scope>Shareable</res-sharing-scope>-->
    </resource-ref>
    </session>
    </enterprise-beans>
    <weblogic-ejb-jar>
    weblogic ejb jar file is the following content.
    <weblogic-enterprise-bean>
    <ejb-name>TMS_DBConnectionBean</ejb-name>
    <stateless-session-descriptor>
    <pool>
         <max-beans-in-free-pool>1</max-beans-in-free-pool>
    </pool>
    </stateless-session-descriptor>
    <jndi-name>TMS_DBConnectionBean</jndi-name>
    </weblogic-enterprise-bean>
    thanx in advance..

    hi
    i tried the same but still i'm getting the same problem, the value i mentioned in the servlet lookup is java:comp/env/TMS_DBConnectionBean.
    then the value returned by the lookup would be java:comp/env/ejb/TMS_DBConnectionBean. right. Anyway i tried the same as u mentioned. that same problem resource not allowed is displayed in the browser. is there any other alternative to solve this?
    thanks

  • Accesing same object from different servlets

    Hello all!
    I am developing a web control project. I am using a simulator of a factory (with java). The engineers are supposed to be able to change some variables from the web.
    I am using servlets to change this variables. My problem is that, to be able to change variables, I need to create an instance of this FactorySimulator object.
    If each servlet ( there are many servlets) calls an instance, they will be updating different FactorySimulator objects.
    How can I make reference, or have acces to the SAME object, from any servlet?
    Thanks! I hope my question is clear =)

    package com.yourcompany.somepackage;
    public class TheFactory
        private static FactorySimulator factory = new FactorySimulator();
        private TheFactory() {} // Static methods only, do not instantiate TheFactory
        public FactorySimulator instance()
            return factory;
    }From each of your servlets you can call TheFactory.instance().doWhataver(). Methods in FactorySimulator need to be suitably synchronized of course.

  • How can a user scroll the resultset obtained from a servlet in a jsp page?

    Actually i am having a page where user has to select company name and for tht i am providing him with a button, and on clicking tht button a
    new search page is provided , and on mentioning the search criteria ,a servlet is fired which returns a list of companies(tbasically i am creating a session object of resultset type which stores the companies name), now the servlets again goes back to search page, and here i want 2 display the company names, i am able to display company names in my search page , but now i want my user to select one of the companies from tht servlet.
    for tht i need to tap the onMouseOver function of java SCript, C
    Can any one tell me how to write code for tht
    Thanking in Advance

    see https://addons.mozilla.org/en-US/thunderbird/addon/send-later-3/

Maybe you are looking for

  • How to use counter as an start and stop trigger in 6009

    Hi ALL. I'm using USB 6009 as a subject of to acquire data. I would like to know on how to use the counter digital input as a start and stop trigger.  The acquisition will only start when the first pulse of the digital signal is received and it will

  • Nokia Communication Centre cannot find my SMS/MMS

    Hello I currently have a Nokia n70, which I am replacing with a new model. However. No Nokia software can find my sms/mms messages so I can take a backup of them. Latest firmware version on the phone:  v 5.0705.3.0.1 Latest version of PC Suite. Windo

  • Ipod photo-can't get  pictures from ipod to pc

    I have pictures in my ipod that I transferred with the USB digital camera connection, but I can't get them onto i-tunes/my computer. I can see them on the ipod, but when I connect to itunes and computer i can't see or access the pictures on either (P

  • Prevent Active Directory Parent Domain Admins from accessing Child Domain

    We want to prevent Parent domain administrators (or a similar profile?) from accessing and/or administering child domains. Is this possible, or do parent domain admins have irrevocable administrative access to any child domain? Asked another way, can

  • Which Eclipse IDE needed

    To create a web application using GWT, JDK 6, JBOSS in my local computer, which Eclipse I should install? Before I installed Eclipse for Java Developer, but from some instruction, I was told I should install "Eclipse IDE for J2EE Developer", do I nee