Servlet doPost never called from VB client

Hi,
          Is there any way I can check that the weblogic server (servlet container?) is receiving the request before forwarding it to my servlet?
          Description:
          I'm using MSXML2.XMLHTTP ActiveX object to post an xml string to a servlet from an Excel add-in.
          This is working in all but one case.
          The problem I have is that one client's request is not being posted, i.e. the doPost(..) is not being called on the servlet.
          Here's the VBA:
          Dim Req As New MSXML2.XMLHTTP
          Req.Open bstrMethod:="POST", bstrUrl:=sUploadServlet, varAsync:=True, bstrUser:=uname, bstrPassword:=pword
          Req.Send sXML
          Observations:
          * The post works if I make the call synchronous (i.e. VB waits for the response)
          * The post works if I don't send the xml string
          * There are no errors raised in the VBA above
          The servlet container is Weblogic running on Solaris with java 1.3, the client VB runs in Excel 2000, IE is version 6 SP2.
          Thanks,
               Antony

Hi friends,
It seems I have finally found the answer to calling doPost() of HttpServlet from applet. Espcially for those who were working on jdk1.3 or previous would notice that after moving to a higher jsdk version, their code has suddenly stopped calling the doPost() method in servlet the answer to this is that remember to call the getResponseMessage() And disconnect() method on the HttpURLConnection after closing the outputStream on it.
This is a sample code to Send the object from applet to servlet in order to invoke doPost() method at the servlet.
//servletGetUser is a url in the form => http://host:port/contextroot/servletName.
     URL DBSrvlet = new URL(servletGetUser);
     HttpURLConnection SrvletConnection = (HttpURLConnection) DBSrvlet.openConnection();
     SrvletConnection.setDoOutput(true);
     SrvletConnection.setRequestMethod("POST");
     SrvletConnection.setUseCaches(false);      
     SrvletConnection.setDefaultUseCaches(false);
     SrvletConnection.setRequestProperty("Content-type","application/x-www-form-urlencoded");
     ObjectOutputStream outputToServlet = new ObjectOutputStream(SrvletConnection.getOutputStream());
     outputToServlet.writeObject(tAdmin);
outputToServlet.flush();     
     outputToServlet.close();
     // Remember your doPost() method gets fired actually by these last 2 lines.
SrvletConnection.getResponseMessage()
     SrvletConnection.disconnect();
Do let me know if this works,
Thanks,
Himanshu B.

Similar Messages

  • When a servlet accepts a call from a client, it receives two objects.what??

    hi,
    When a servlet accepts a call from a client, it receives two objects. What are they???

    How will u pass the argument from one servlet to another servlet??Actually, it's dead simple: Just tell servlet #1 that servlet #2 said something nasty about servlet #1's mother and sister, so servlet #1 will head-butt servlet #2 and you have the argument passed along ...

  • Servlet doPost not called problem

    Hello, I have searched the topics related the this problem, and I still can not solve the problem, please somebody help.
    I have wrote the simple test servlet and applet to send and receive the data, my sample code are as following:
    On the applet side
    URL url = null;
    HttpURLConnection con = null;
    ObjectOutputStream outputToServlet = null;
    try
    url = new URL(urlString);
    con = (HttpURLConnection)url.openConnection();
    con.setUseCaches(false);
    con.setDefaultUseCaches (false);
    con.setDoInput(true);
    con.setDoOutput(true);
    con.setRequestProperty("Content-Type","application/octet-stream");
    con.setRequestMethod("POST");
    outputToServlet = new ObjectOutputStream(con.getOutputStream());
    outputToServlet.writeObject(itemType);// itemType is an object which implements serializable interface
    outputToServlet.flush();
    outputToServlet.close();
    con.disconnect();
    catch(Exception ex)
    ex.printStackTrace();
    On the servlet side the code is:
    System.out.println("doPost is being calling now");
    ObjectInputStream inputFromApplet = null;//objStream
    ItemType itemType = null;
    try {
    // get an input stream from the applet
    inputFromApplet = new ObjectInputStream(request.getInputStream());
    // read the serialized itemType data from applet
    itemType = (ItemType)(inputFromApplet.readObject());
    inputFromApplet.close();
    catch (Exception e)
    e.printStackTrace();
    But the doPost doesn't be invoked at all, does anybody have any idea?
    Please help, and Thanks
    Billsend

    Hi friends,
    It seems I have finally found the answer to calling doPost() of HttpServlet from applet. Espcially for those who were working on jdk1.3 or previous would notice that after moving to a higher jsdk version, their code has suddenly stopped calling the doPost() method in servlet the answer to this is that remember to call the getResponseMessage() And disconnect() method on the HttpURLConnection after closing the outputStream on it.
    This is a sample code to Send the object from applet to servlet in order to invoke doPost() method at the servlet.
    //servletGetUser is a url in the form => http://host:port/contextroot/servletName.
         URL DBSrvlet = new URL(servletGetUser);
         HttpURLConnection SrvletConnection = (HttpURLConnection) DBSrvlet.openConnection();
         SrvletConnection.setDoOutput(true);
         SrvletConnection.setRequestMethod("POST");
         SrvletConnection.setUseCaches(false);      
         SrvletConnection.setDefaultUseCaches(false);
         SrvletConnection.setRequestProperty("Content-type","application/x-www-form-urlencoded");
         ObjectOutputStream outputToServlet = new ObjectOutputStream(SrvletConnection.getOutputStream());
         outputToServlet.writeObject(tAdmin);
    outputToServlet.flush();     
         outputToServlet.close();
         // Remember your doPost() method gets fired actually by these last 2 lines.
    SrvletConnection.getResponseMessage()
         SrvletConnection.disconnect();
    Do let me know if this works,
    Thanks,
    Himanshu B.

  • Servlet doPost being called twice

    Hello all,
    I have a servlet that is being called twice. The servlet is used to direct the user to the next jsp. I have 4 JSPs that the user steps through to add a record to a database. The 1st JSP lists the records that they have and asks them to add, edit or delete. The servlet gets call to direct them to the next JSP that they enter the data (or update) on. It then calls a verification JSP so the user can verify the information before submitting it. If everything is fine they submit the data. This verification JSP calls the servlet that adds or updates the record in the database. The servlet then directs the user to a confirmation page that tells the user if the submit was successful or not.
    Here is how the flow is:
    servlet -->menu.jsp -->servlet -->add.jsp -->verification.jsp -->servlet -->confirmation.jsp
    Everything is fine until the verification.jsp submits to the servlet. That's where the doPost gets called twice.
    I have put System.outs in the servlet code to see how many times the doPost gets called. It gets called once for every JSP except the verification JSP. When the user submits the data, the servlet's doPost gets called twice therefore it tries to add the record twice.
    Has anyone had this problem before? How do I fix it?
    Any help would be greatly appreciated!!
    Tracey

    Here is the output of the JSP that when submitted, calls the doPost twice:
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <TITLE>PreaPaid Legal Banner Verification</TITLE>
    <script language="javascript">
    function new_window(url){
    link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=650,height=450,left=50,top=50");
    </script>
    </HEAD>
    <BODY>
    <form name="myForm" action="/webapp/BannerTracker/BannerTrackingServlet" method="post">
    <H3><font face="Arial">Banner Tracking Verification</font></H3>
    <table BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=2 WIDTH=500><tr><td>
    <font face="Arial" size=2>Below are the choices that you made for your image, size of the image and page to direct people to
    when they click on your banner.
    <br><br>If this is not what you would like, click the "Back" button to return to the Banner Selection page.
    <br><br>You can click on the page link to view a sample of the age you have choosen.
    </font></td></tr></table>
    <P>
    <font face="Arial" size=2>
    <input type="hidden" name="cmd" value="doadd">
    <input type="hidden" name="banname" value="yahoo">
    <input type="hidden" name="banlogin" value="test">
    <input type="hidden" name="banid" value="1">
    <input type="hidden" name="bangname" value="difference">
    <input type="hidden" name="bangsize" value="468x60">
    <input type="hidden" name="banpage" value="go/test?:home">
    <input type="hidden" name="session" value="PPL2P6LcONLiT45pSszZEb1GJ4HvRc5jQMDNPM8wCJ0rCZesD38oEZ4mC3KvCp8mDp00">
    <input type="hidden" name="bangtype" value="gif">
    <input type="hidden" name="banurl" value="<A HREF="http://www.prepaidlegal.com/go/test?banid=1&Assoc=test"><img src="http://www.prepaidlegal.com/html/buttonsdifference468x60.gif" border=0></A>">
    <br><b>Banner name: </b>yahoo
    <br><br><b>Page to be directed: </b>Your PPL Home Page
    <br><br><b>Image selected: </b><img src=/html/buttons/difference468x60.gif >
    <br><br><b>Copy the URL below to the banner source code.</b>
    <br><br><img src="http://www.prepaidlegal.com/html/buttonsdifference468x60.gif " border=0>
    </font>
    <br><br>
    <a><img src="/html/buttons/track_back.gif" border=0 onClick="window.history.back();"></a>
    <input type=image src="/html/buttons/track_continue.gif" border=0 onClick="javascript:document.myForm.submit();">
    </form>
    </BODY>
    </HTML>
    Here is the doPost code from my servlet:
    public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    System.out.println("doPost called");
    String next = "";
    try
    Command cmd = lookupCommand(req.getParameter("cmd"));
    next = cmd.execute(req);
    } catch (CommandException ce) {
    req.setAttribute("javax.servlet.jsp.jspException", ce);
    next = error;
    } catch (SQLException se) {
    req.setAttribute("javax.servlet.jsp.jspException", se);
    next = error;
    HttpSession mysession = req.getSession(true);
    String session = String.valueOf(mysession.getAttribute("storedSession"));
    if (session.equalsIgnoreCase("null"))
    session = req.getParameter("session");
    try
    checkSession(session);
    } catch (IOException ioe) {
    System.err.println("Session exception: " + ioe.getMessage() + ".");
    next = expire;
    } else {
    try
    checkSession(session);
    } catch (IOException ioe) {
    System.err.println("Session exception: " + ioe.getMessage() + ".");
    next = expire;
    if ( session != null )
    mysession.setAttribute("storedSession", session);
    RequestDispatcher rd;
    rd = getServletContext().getRequestDispatcher(jspdir + next);
    rd.forward(req, res);
    </code>
    I hope this helps.
    Tracey

  • ESB Webservice call from Java client

    Hi,
    i need to call webservice from Java client which inturn will call ESB
    I tried creating proxy from the WSDL in jDeveloper and tried setting the following end points
    My concrete WSDL path :http://10.237.25.63:8889/esb/wsil/SubroCaseESBSystem/InputRouter?wsdl
    My EM -path:"http://10.237.25.63:8889/event/subrotest/SubroInputrouter"
    When i call the concreteWSDL im getting
    "HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 405 Method Not Allowed"
    If i call the EM pathim getting
    "javax.xml.rpc.soap.SOAPFaultException"
    Any guess as how i need to call my ESB from client.

    Hello Venkat,
    - I have created Java Proxy using Jdeveloper for ESB webservice and I usually use http://host:port/event/...?wsdl, and it creates stub which works without any modification. Let me know, may be I can try sending sample project
    - I would like to verify if you are having issue with Java client or ESB itself, are you able to execute that ESB process/service from EM test page or from any other BPEL process?
    Regards,
    Chintan

  • Web Service Call From Proxy Client in ABAP: View SOAP Request

    Hello All,
    We are working on a scenario where we have to connect to a web service from ABAP. We have extracted the WSDL, and generated the client proxy, and configured a Logical Port. However, at the time of actual call, we receive an error message "Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message.". We suspect that this is a problem with the SOAP Header, which might be missing some tags, which are required by the Web Service. Problem is, we can not trace the Web Service SOAP Header. We can not see it in SOAMANAGER, or any other transaction as such. Does any body have an idea where to look for the complete SOAP Request, in case of a Client Proxy call?
    Thanks and Regards,
    Sid

    Hello Sebastian,
    Thanks for replying. We are using a higher support pack level, and hence we do not use LPCONFIG; rather we use SOAMANAGER to manage the web service logical ports. Further, SMICM would display us ICM Logs, where as we need the exact SOAP request that has been generated. We tried ST11 with no luck.
    Finally, I feel this is a wrong forum to ask such an application related question. I will close this thread and open a new thread in either PI or ABAP Forum.
    Thanks and Regards,
    Sid

  • Direct Database calls from FLEX client

    Hi all,
    is there any way to make direct database calls to a MySQL database (or any other database) from a FLEX client, rather than invoking through a service? simply, i need to remove the middle tier.
    Thanks in advance.
    SajKK

    Air only supports SQL Lite for now may be more in future.
    http://www.adobe.com/devnet/air/ajax/quickstart/sync_simple_sql_database.html
    http://www.insideria.com/2008/03/air-api-querying-a-local-datab.html
    http://ntt.cc/2008/07/08/sqlite-example-for-adobe-air-working-with-local-sql-databases-wit h-source-code.html

  • How to get the Runstate variable of an external sequence called from the Client Sequence through Sequencecall?

    Hi,
               I need to change the runtime high and lo limit values of all the tests of the client sequence file before running it. My sequence file is having a SequenceCall which calls an external sequence. Can anyone tell me how to change/access the High and lo limit values of the external sequence test steps?
    Thanks,
    Jeyan

    Doug,
              I used the property loader method but I could not load the limits of any sub sequence call calling an external sequence file.
    I took the FlowRate_test.seq example from the NI Example folder "C:\Documents and Settings\All Users\Documents\National Instruments\TestStand 4.2.1\Examples\PropertyLoader\LoadingLimits\LimitsFromExcelFile\UsingCVI". I created a sequence called PumpTest.seq in the same folder path. I then moved the Pump Test step from the FlowRate_test.seq to the PumpTest.seq. Now created a sequence call in the FlowRate_test.seq and called the PumpTest.Seq as the module path. When I execute the FlowRate_test.seq , I get the error as shown below:
    Attached is the Flowrate_Test.seq and the PumpTest.seq which should be there in the folder path "C:\Documents and Settings\All Users\Documents\National Instruments\TestStand 4.2.1\Examples\PropertyLoader\LoadingLimits\LimitsFromExcelFile\UsingCVI".
    Let me know whether I am doing something wrong in this method. 
    My idea is to alter the runstate variable High and Low of Pump Test in the PumpTest.seq and then run the Flowrate_Test.seq.
    Attachments:
    PumpTest.seq ‏6 KB
    FlowRate_test.seq ‏11 KB

  • RMI: can a client support cuncurrent calls from others client?

    Hi, I'm trying to build a simple peer 2 peer system.
    My clients, when registering to the server, are passing a ResourceList (class that extends Remote) to the server, so that the server has a complete list of all the resources of the connected clients.
    When a client search something, the server returns to him the list containing the searched resource(remote reference to the list of the owner client), and the searching client can call a getResource on the remote reference, that returns the Resource (serializable).
    Now I'm wondering, if more than one client get the same remote reference to a list, and call getResource at the same time, what will happen?
    Since each client for RMI is a thread, it's like n treads are calling the same method, that actually is remote.
    So, if I synchronize this (remote) method, I can assure that only one client at time gets the Resource, but what if the client dies while having the lock on the resource?
    Thanks in advance for any answer.

    Now I'm wondering, if more than one client get the same remote reference to a list, and call getResource at the same time, what will happen? The same what happens in normal (non-remote) application with several threads calling the same method.
    Since each client for RMI is a thread, it's like n treads are calling the same method. Right.
    So, if I synchronize this (remote) method, I can assure that only one client at time gets the Resource,It depends what you mean by "gets the Resource". By synchronizing a method you assure that the execution of this method will be synchronized, but you cannot say this about the clients using the Resource later.
    but what if the client dies while having the lock on the resource?Generally you don't have to worry about it, it will be handled by JVM. Either the client thread will die prematurely (and release the lock) or will execute normally and time out later when trying to send the response back to the client over (proably dead) connection. But in your case the resource will not be locked! You are synchronizing a method which basically assures that just a single thread may execute this method at a time.
    Edited by: AdamDyga on Jun 24, 2010 3:59 PM

  • Endeca webservice call from different Application.

    I am trying to call the Endeca (v2.2.2) Webservice, using the client generated class file from the wsdl file (conversation.wsdl) and pass the query to get the result. Steps so far did
    •     Use apache cxf codegen plugin 2.7.0 to generate the client classes using the above wsdl.
    •     Written junit test case for client class and send the query to server. I can connect to the server but getting back the ConversationFault: Sequence has length 0 but must have length 1
    •     The only method I can use to call from the client is conversationPort.query(request), which is generated by cxf wd12java
    •     Following is the line of code from the client class
    ContentElementConfig config = new ContentElementConfig();
    config.setHandlerFunction("AS select max(p_common_date_epoch) as 'MaxDate' where Social_Media_Type = 'Twitter' group by interaction_author_username, interaction_text, interaction_link, Klout_Score, Followers_Count, DocumentSentiment, calculated_entity_sentiment, SalienceSentiment order by MaxDate desc, Followers_Count desc page (0,50)");
    Request request = new Request();
    request.setState(null);
    request.getContentElementConfig().add(config);
    Client Call: Results results = webServiceClient.readQueryResults(request); // this method internally calls conversationPort.query(request).
    Any thoughts or recommendation please advise.
    Edited by: user4993272 on May 9, 2013 10:57 AM

    Hi,
    i have two application take as App1 and App2 .i want to make a webservice call from App1 to App2 . through this webservice call i will pull the data from App2 and populate the data inside a .jspx file.
    i am not understanding how i will do that.
    A service wont allow you to access the live instance of an application and instead create its own data session. So while you can query data that belongs to App2, you wont be able e.g. to access a users uncommitted data changes
    Frank

  • Transfer call from federated failed

    Hi
    I am testing transfer call from federated client , I am transferring it to another lync user or to PSTN and both giving transfer not complete with error 
    can not complete transfer error ID 404 , source ID 239
    the nice thing that I am not seeing any error with red flag in the S4 & SIP Stack event of the lync edge and FE , and when I search for the contact of the transferred user I can't find his name too in logs !
     any suggestion will be helpful
    by the way the internal transfer for incoming/outgoing working fine , I tried to disable/enable refer but same result , anyway I think the transfer to internal LYNC client doesn't need refer changes as it is for gateway only
    I am testing the call from my Skype account
    Thanks

    I would fix OCSLogger on your edge server and post that log:
    Issues with OCSLogger and the Outbound routing messages in Snooper on Lync 2013.
    Try the following:
    Close Snooper and OCSLogger
    Rename the default.tmx file in C:\Program Files\Microsoft Lync Server 2013\Debugging Tools directory to default.tmx.old
    Copy the default.tmx file from c:\Program Files\Common Files\Microsoft Lync Server 2013\Tracing To C:\Program Files\Microsoft Lync Server 2013 Debugging Tools.
    Start OCSLogger again and run your scenario.

  • Help : Calling a Servlet.doPost from a HTML Form (404 Error !!!)

    All
    I trying to make a call to a doPost method of a servlet from the doGet method of the same servlet.
    The call is made from an HTML form, so
    *<form name="input" action="servlet/deleteAlertPage" method="post">*
    ======================================================================
    The web.xml file entry is as follows:
    *<servlet>*
    *<servlet-name>deleteAlertPage</servlet-name>*
    *<servlet-class>bsp.perceptive.custom.webapp.deleteAlert.deleteAlertPage</servlet-class>*
    *<load-on-startup>0</load-on-startup>*
    *</servlet>*
    *<servlet-mapping>*
    *<servlet-name>deleteAlertPage</servlet-name>*
    *<url-pattern>/deleteAlertPage</url-pattern>*
    *</servlet-mapping>*
    So when I run my Servlet from my JDeveloper, I do see the “doGet” method getting executed successfully and I see my HTML from appearing on a browser page.
    As soon as I press the submit button, where I want the “doPost” method to get executed, I get the following error:
    Error 404--Not Found
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    *10.4.5 404 Not Found*
    The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
    If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead.
    The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource
    is permanently unavailable and has no forwarding address.
    Any ideas ? Is my Servlet Setup and Execution Correct ?
    Any help is appreciated.
    My JDeveloper Version is the latest release :
    About
    Oracle JDeveloper 11g Release 1 11.1.1.2.0
    Studio Edition Version 11.1.1.2.0
    Build JDEVADF_11.1.1.2.0_GENERIC_091029.2229.5536
    Copyright © 1997, 2009 Oracle and/or its affiliates. All rights reserved.
    IDE Version: 11.1.1.2.36.55.36
    Product ID: oracle.jdeveloper
    Product Version: 11.1.1.2.36.55.36
    Any help and advice is greatly appreciated.
    Regards
    patrice

    John
    I got it to work !!
    I had to place the application name in the action value also I had to change the port number, from 8080 to be 7101.
    However
    It was not that straight forward, because when I created my web Application I gave it the application Name of "BSPCustPerWebApps" and Project Name of "BSPCustPerWebApps"and this is reflected in my JDeveloper folder structure: "....\mywork\BSPCustPerWebApps\BSPCustPerWebApps\src\bsp\perceptive\custom\webapp\deleteAlert"
    now when I run my Servlet initially I noticed that Browser URL is saying : http://localhost:7101/BSPCustPerWebApps-BSPCustPerWebApps-context-root/deleteAlertPage
    which means that the web application is : BSPCustPerWebApps-BSPCustPerWebApps-context-root
    so I changed my action value to be
    action="http://localhost:7101/BSPCustPerWebApps-BSPCustPerWebApps-context-root/deleteAlertPage"
    and that worked.
    Weblogic must have created/defauled the application name using the application name and project name that I gave duriung the servlet creation.
    Is there a way of changing the application name to be something shorter and more meaningfull ?
    Also I did not want to hard code the server name, port etc in the action value, so again is there way of making this to be derived ?
    Do you know how to access the WebLogic Console ? , considering I have only installed JDev, which has an embedded weblogic server.
    Thanks for your help.

  • How can I display the HTML page from servlet which is called by an applet

    How can I display the HTML page from servlet which is called by an
    applet using the doPost method. If I print the response i can able to see the html document. How I can display it in the browser.
    I am calling my struts action class from the applet. I want to show the response in the same browser.
    Code samples will be appreciated.

    hi
    I got one way for this .
    call a javascript in showDocument() to submit the form

  • 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.

  • JCD - making a web service client call from a jcd

    Hi,
    We would like to make web service client calls from our jcd's in Java CAPS 5.1.2 to an external web services running under a Tomcat 5.5 servlet.
    What is the recommended method of calling web services from a jcd?
    We attempted to import a WSDL and use the wsdl object but that failed.
    One alternative I thought of is generating the client classes from Axis 1.3 and importing an external .jar file with those classes plus the necessary jar to run Axis.
    Our external web services are typed as docment/literal, wrapped.
    Thanks

    The recommended way to make Web Services calls from a Java Collaboration is to use the support for this feature in JCaps 5.1.2. This means using the WSDL as an OTD and linking it to an external web service on the connectivity map.
    If you have trouble using the WSDl as an OTD you can open a support case with Sun support (http://goldstar.stc.com/support).
    Regards,
    Frederik

Maybe you are looking for

  • Help me to solve this Jsp problem

    //Class1.java package p1.p2; public class Class1 implements Serializable private String name1,name2; public void setName1(String name) name1=name; public String getName1() return name1; public void setName2(String name) name2=name; public String getN

  • Oracle 8.1.7/9iAS installation problem on IBM AIX 5.1 - loadext fails

    Dear colleagues, tried to install Oracle 8.1.7 and then Oracle 9iAS over AIX 5.1 on IBM eServer p-series. The installation fails in the very beginning - loadext for post-wait Kernel Extension (/etc/pw-syscall) fails with 'exec format error'. Document

  • VerifyError: Error #1053: Illegal override of isRelatedObjectInaccessible in RemappedMouseEvent.

    I am having trouble running AIR applications with Flex SDK 4.0 (and 4.1). Here is what I am doing: On OS X 10.6.4 using eclipse with Flex Builder 3 installed I create a new flex project with AIR. I have eclipse setup to use the SDK flex_sdk_4.1.0.160

  • Can't import Media into FCP X

    In the last week or two when I try to import media into FCP X I end up with a very dark and locked import screen.  The only way I can recover is to force quit FCP X.  It doesn't always happen but it is getting more and more frequent. I have not updat

  • Software Audigy2Zs e Audigy4Pro for vist

    Hello to all,?is?previewed one development of the software of management of cards audigi 2 zs and audigy 4?, compatible with windows vista?Thanks...