Help with J2EE Servlet

I am creating a website to help unfortunate individuals. It is modeled after this. http://news.bbc.co.uk/2/hi/health/3164021.stm
Right now, there is no way to make an immediate deposit. I want to include a static resource of a picture in my JSP page. Then when the user is ready, he presses a button and is transfered to a page where a deposit can be made. Of course, he doesn't need to move forward. He can deposit on the current page, if you know what I mean.
Anyway, my question is this: which RequestDispatcher should I use?

Anyway, my question is this: which
RequestDispatcher should I use?
Use JizzDispatcher for remote apps
Locale instances can be created by applying Palm resources
to Cyclops.

Similar Messages

  • Help with J2EE SDK 1.4 Virtual Servers please!

    H!
    Are we doomed to have just one virtual server pointing to port 80??
    I have a Win2K computer with J2EE App Server 1.4. In this computer I stopped the IIS 5.0 in order to use the HTTP Server included with the product. I also run the DNS on the same machine with 3 domains. All name resolutions for these 3 domains work fine.
    Now I want to enter to any of the 3 domains freely and execute JSP apps. But I don't want to enter ports numbers like this:
    http://www.mytest.com:8081/hello.jsp
    I just want to enter:
    http://www.mytest.com/hello.jsp
    So I defined a new http-port listener pointing to the 80 port on this server. With no SSL support.
    Name: http-port80
    IP Address: 0.0.0.0
    POrt: : 80
    Then I defined a new virtual server using the http-port listener. I set the following fields:
    ID: mytest
    Hosts: www.mytest.com
    HTTP Listener: http-port80 (This is the name of the port listener)
    Everything seems to be fine. I can enter http://www.mytest.com and call the hello.jsp it's ok.
    But then I create a new virtual server for http://www.mytest2.com exactly as the one for the www.mytest.com, except for the host field: http://www.mytest2.com
    Then when I restart the app server I got the message on the log: "Port already in use".
    I don't want to enter http://www.mytest2.com:<port> but I've read that you cannot assign the same http-listener to 2 virtual servers, so I created another listener pointing to the same port 80. But I still have the same error.
    Any ideas how to handle this?
    Am I doing something wrong on the configuration?
    Thank you very much!!

    I can help you out with this, because I just solved this problem using the Apache web server 2.0 with mod_proxy and mod_proxy_http.
    this is how the configuration works.
    setup sunone creating one virtual host for each http-listener on a different port. and make sure these ports are any port except the 80. -- we will configure apache on this port and then use it as a reverse proxy to get to our hosts.
    like this
    virtual-listener-1 - port 8081
    virtual-listener-2 - port 8082
    virtual-listener-3 - port 8083
    virtual-host-1: www1.domain.com bind to: virtual-listener-1
    virtual-host-2: www2.domain.com bind to: virtual-listener-2
    virtual-host-3: www3.domain.com bind to: virtual-listener-3
    now download apache with all the modules http://www.apache.org
    in your httpd.conf add the following lines of code.
    #the code below will tell apache to enable the proxy for your host
    <IfModule mod_proxy.c>
    # Proxy Server directives. Uncomment the following lines to
    # enable the proxy server:
    ProxyRequests On
    <Proxy *>
    Order deny,allow
    Deny from all
    Allow from www1.domain.com
    Allow from www2.domain.com
    Allow from www3.domain.com
    </Proxy>
    # Enable/disable the handling of HTTP/1.1 "Via:" headers.
    # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
    # Set to one of: Off | On | Full | Block
    ProxyVia On
    # End of proxy directives.
    </IfModule>
    NameVirtualHost *:80
    <VirtualHost *:80>
    ServerName www1.domain.com
    <Location />
    Order allow,deny
    Allow from all
    ProxyPass http://sunoneserver:8081/
    </Location>
    </VirtualHost>
    <VirtualHost *:80>
    ServerName www2.domain.com
    <Location />
    Order allow,deny
    Allow from all
    ProxyPass http://sunoneserver:8082/
    </Location>
    </VirtualHost>
    <VirtualHost *:80>
    ServerName www3.domain.com
    <Location />
    Order allow,deny
    Allow from all
    ProxyPass http://sunoneserver:8083/
    </Location>
    </VirtualHost>
    note the sunone server indicates the server where you installed sunone-as (J2EE 1.4). this will give you the result you are looking for: all three of these sites will run on port 80 and each of them will respond to a different web application on sunone.
    there are naturally limits because when you run out of ports on your application server this won't work any more but then again there are about 60000 of those free and i don't think you will be able to run that many sites on one server anyway.
    Chris.

  • Help with J2EE Project Management

    Hi,
    We are about to begin a large J2EE project and are wondering if anyone could help with the following questions:
    1. Given the division of labor on J2EE projects (JSP developers, EJB developers, application deployers, etc...), what are "best practices" for building a team and ensuring that they communicate well after the design phase? How will the left arm know what the right arm is doing?
    2. What documentation should be produced during the design phase to give to the developers? Will this allow them to go off and develop independently of each other?
    3. Is there a "best practices" document anywhere on J2EE project management?
    Thanks in advance!!

    Hi,
    I feel any project to start with should have a prior planning,that too particularly for Object oriented programming projects,I feel UML is the best tool for entire process.I think rational software has got lot of Project Management Tools(PMT) and products at all stages.Please go through the rational.com site and hope you could find some info.I feel the answer to your second question is partly 'yes' and partly 'no'.The modules that you can split it up which have got some independent attributes,but it should not be too much in your project,then it affects the work matrix/There should be a optimal process to decide and that you can yourself formulate depending on the time frame,either way the last step of build or integration is not flexible enough that you should mind,modular flexibility can be there but the integration stage you are tied with a fixed process.So plan accordingly using a PMT tool for any project that matters and all the best.Bye
    Hari

  • Need help with applet servlet communication .. not able to get OutputStream

    i am facing problem with applet and servlet communication. i need to send few image files from my applet to the servlet to save those images in DB.
    i need help with sending image data to my servlet.
    below is my sample program which i am trying.
    java source code which i am using in my applet ..
    public class Test {
        public static void main(String argv[]) {
            try {
                    URL serverURL = new URL("http://localhost:8084/uploadApp/TestServlet");
                    URLConnection connection = serverURL.openConnection();
                    Intermediate value=new Intermediate();
                    value.setUserId("user123");
                    connection.setDoInput(true);
                    connection.setDoOutput(true);
                    connection.setUseCaches(false);
                    connection.setDefaultUseCaches(false);
                    // Specify the content type that we will send binary data
                    connection.setRequestProperty ("Content-Type", "application/octet-stream");
                    ObjectOutputStream outputStream = new ObjectOutputStream(connection.getOutputStream());
                    outputStream.writeObject(value);
                    outputStream.flush();
                    outputStream.close();
                } catch (MalformedURLException ex) {
                    System.out.println(ex.getMessage());
                }  catch (IOException ex) {
                        System.out.println(ex.getMessage());
    }servlet code here ..
    public class TestServlet extends HttpServlet {
         * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
         * @throws ServletException if a servlet-specific error occurs
         * @throws IOException if an I/O error occurs
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
             System.out.println(" in servlet -----------");
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            ObjectInputStream inputFromApplet = null;
            Intermediate aStudent = null;
            BufferedReader inTest = null;
            try {         
                // get an input stream from the applet
                inputFromApplet = new ObjectInputStream(request.getInputStream());
                // read the serialized object data from applet
                data = (Intermediate) inputFromApplet.readObject();
                System.out.println("userid in servlet -----------"+ data.getUserId());
                inputFromApplet.close();
            } catch (Exception e) {
                e.printStackTrace();
                System.err.println("WARNING! filename.path JNDI not found");
            } finally {
                out.close();
        @Override
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
            System.out.println(" in foGet -----------");
            processRequest(request, response);
         * Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
         * @throws ServletException if a servlet-specific error occurs
         * @throws IOException if an I/O error occurs
        @Override
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
            System.out.println(" in doPost -----------");
            processRequest(request, response);
         * Returns a short description of the servlet.
         * @return a String containing servlet description
        @Override
        public String getServletInfo() {
            return "Short description";
        }// </editor-fold>
    }the Intermediate class ..
    import java.io.Serializable;
    public class Intermediate implements Serializable{
    String userId;
        public String getUserId() {
            return userId;
        public void setUserId(String userId) {
            this.userId = userId;
    }

    Hi,
    well i am not able to get any value from connection.getOutputStream() and i doubt my applet is not able to hit the servlet. could you review my code and tell me if it has some bug somewhere. and more over i want to know how to send multiple file data from applet to servlet . i want some sample or example if possible.
    do share if you have any experience of this sort..
    Thanks.

  • HELP WITH J2EE

    YESTARDAY I WAS WORKING WITH THE VISUAL ADMI NISTRATOR. THE SERVER SHUTDOWN BECAUSE HAD A FAILD WITH THE ENERGY. WHEN THE SERVER START AGAIN, I CANNOT GET UP, THE J2EE, MY SYSTEM IS A PI 7.00, WHEN I TRY TO ENTER TO EXCHANGE PROFILE, I CANNOT, THE BROWSER SHOW ME, A MESSAGE THAT SAY THE URL DOES NOT EXIT. WHEN I SEE THE TRANSACTION SMMS, DOES NOT SHOW ME THE J2EE.
    SOMEONE COULD HELP ME.
    THANKS
    ATTM LITTLE JUANITO

    Thanks for your attention.
    my system is AIX 5.300.
    this is the content of  dev_server0
    [Thr 47292] ***LOG Q0I=> NiPConnect: connect (79: A remote host refused an attem
    pted connect operation.) [nixxi.cpp 2460]
    [Thr 47292] *** ERROR => NiPConnect: SiConnect failed for hdl 60 / sock 114
        (SI_ECONN_REFUSE/79; I4; ST; 172.16.204.56:3300) [nixxi.cpp    2460]
    [Thr 47292] *** ERROR => GwIConnect: GwConnect to sapsrqdb / sapgw00 failed (rc=
    NIECONN_REFUSED) [gwxx_mt.c    296]
    [Thr 47292] ***LOG S0T=> GwIConnect, GwConnect (-0010) [gwxx_mt.c    297]
    [Thr 47292] ***LOG S0R=> GwIConnect, GwConnect () [gwxx_mt.c    299]
    [Thr 47292] ***LOG S0S=> GwIConnect, GwConnect (sapgw00) [gwxx_mt.c    301]
    [Thr 47292] ***LOG S90=> SAP_CMREGTP3, GwIConnect ( 236) [r3cpic_mt.c  9624]
    [Thr 47292]
    [Thr 47292] *  ERROR       partner 'sapsrqdb:sapgw00' not reached
    [Thr 47292] *
    TIME        Tue Apr 15 15:51:48 2008
    [Thr 47292] *  RELEASE     700
    [Thr 47292] *  COMPONENT   NI (network interface)
    [Thr 47292] *  VERSION     38
    [Thr 47292] *  RC          -10
    [Thr 47292] *  MODULE      nixxi.cpp
    [Thr 47292] *  LINE        2460
    [Thr 47292] *  DETAIL      NiPConnect
    [Thr 47292] *  SYSTEM CALL connect
    [Thr 47292] *  ERRNO       79
    [Thr 47292] *  ERRNO TEXT  A remote host refused an attempted connect operation.
    [Thr 47292] *  COUNTER     55
    [Thr 47292] *
    [Thr 47292] ********************************************************************
    [Thr 47292] Tue Apr 15 15:51:50 2008
    [Thr 47292] ***LOG Q0I=> NiPConnect: connect (79: A remote host refused an attem
    pted connect operation.) [nixxi.cpp 2460]
    [Thr 47292] *** ERROR => NiPConnect: SiConnect failed for hdl 71 / sock 95
        (SI_ECONN_REFUSE/79; I4; ST; 172.16.204.56:3300) [nixxi.cpp    2460]
    [Thr 47292] *** ERROR => GwIConnect: GwConnect to sapsrqdb / sapgw00 failed (rc=
    NIECONN_REFUSED) [gwxx_mt.c    296]
    [Thr 47292] ***LOG S0T=> GwIConnect, GwConnect (-0010) [gwxx_mt.c    297]
    [Thr 47292] ***LOG S0R=> GwIConnect, GwConnect () [gwxx_mt.c    299]
    [Thr 47292] ***LOG S0S=> GwIConnect, GwConnect (sapgw00) [gwxx_mt.c    301]
    [Thr 47292] ***LOG S90=> SAP_CMREGTP3, GwIConnect ( 236) [r3cpic_mt.c  9624]
    [Thr 47292]
    [Thr 47292] *  ERROR       partner 'sapsrqdb:sapgw00' not reached
    [Thr 47292] *
    TIME        Tue Apr 15 15:51:50 2008
    [Thr 47292] *  RELEASE     700
    [Thr 47292] *  COMPONENT   NI (network interface)
    [Thr 47292] *  VERSION     38
    [Thr 47292] *  RC          -10
    [Thr 47292] *  MODULE      nixxi.cpp
    [Thr 47292] *  LINE        2460
    [Thr 47292] *  DETAIL      NiPConnect
    [Thr 47292] *  SYSTEM CALL connect
    [Thr 47292] *  ERRNO       79
    [Thr 47292] *  ERRNO TEXT  A remote host refused an attempted connect operation.
    [Thr 47292] *  COUNTER     57
    [Thr 47292] *
    [Thr 47292] ********************************************************************
    [Thr 47292] ***LOG Q0I=> NiPConnect: connect (79: A remote host refused an attem
    pted connect operation.) [nixxi.cpp 2460]
    [Thr 47292] *** ERROR => NiPConnect: SiConnect failed for hdl 71 / sock 95
        (SI_ECONN_REFUSE/79; I4; ST; 172.16.204.56:3300) [nixxi.cpp    2460]
    [Thr 47292] *** ERROR => GwIConnect: GwConnect to sapsrqdb / sapgw00 failed (rc=
    NIECONN_REFUSED) [gwxx_mt.c    296]
    [Thr 47292] ***LOG S0T=> GwIConnect, GwConnect (-0010) [gwxx_mt.c    297]
    [Thr 47292] ***LOG S0R=> GwIConnect, GwConnect () [gwxx_mt.c    299]
    [Thr 47292] ***LOG S0S=> GwIConnect, GwConnect (sapgw00) [gwxx_mt.c    301]
    [Thr 47292] ***LOG S90=> SAP_CMREGTP3, GwIConnect ( 236) [r3cpic_mt.c  9624]
    [Thr 47292]
    [Thr 47292] *  ERROR       partner 'sapsrqdb:sapgw00' not reached
    [Thr 47292] *
    TIME        Tue Apr 15 15:51:50 2008
    [Thr 47292] *  RELEASE     700
    [Thr 47292] *  COMPONENT   NI (network interface)
    [Thr 47292] *  VERSION     38
    [Thr 47292] *  RC          -10
    [Thr 47292] *  MODULE      nixxi.cpp
    [Thr 47292] *  LINE        2460
    [Thr 47292] *  DETAIL      NiPConnect
    [Thr 47292] *  SYSTEM CALL connect
    [Thr 47292] *  ERRNO       79
    [Thr 47292] *  ERRNO TEXT  A remote host refused an attempted connect operation.
    [Thr 47292] *  COUNTER     59
    [Thr 47292] *
    [Thr 47292] ********************************************************************
    [Thr 47292] ***LOG Q0I=> NiPConnect: connect (79: A remote host refused an attem
    pted connect operation.) [nixxi.cpp 2460]
    [Thr 47292] *** ERROR => NiPConnect: SiConnect failed for hdl 71 / sock 95
        (SI_ECONN_REFUSE/79; I4; ST; 172.16.204.56:3300) [nixxi.cpp    2460]
    [Thr 47292] *** ERROR => GwIConnect: GwConnect to sapsrqdb / sapgw00 failed (rc=
    NIECONN_REFUSED) [gwxx_mt.c    296]
    [Thr 47292] ***LOG S0T=> GwIConnect, GwConnect (-0010) [gwxx_mt.c    297]
    [Thr 47292] ***LOG S0R=> GwIConnect, GwConnect () [gwxx_mt.c    299]
    [Thr 47292] ***LOG S0S=> GwIConnect, GwConnect (sapgw00) [gwxx_mt.c    301]
    [Thr 47292] ***LOG S90=> SAP_CMREGTP3, GwIConnect ( 236) [r3cpic_mt.c  9624]
    [Thr 47292]
    [Thr 47292] *  ERROR       partner 'sapsrqdb:sapgw00' not reached
    [Thr 47292] *
    TIME        Tue Apr 15 15:51:50 2008
    [Thr 47292] *  RELEASE     700
    [Thr 47292] *  COMPONENT   NI (network interface)
    [Thr 47292] *  VERSION     38
    [Thr 47292] *  RC          -10
    [Thr 47292] *  MODULE      nixxi.cpp
    [Thr 47292] *  LINE        2460
    [Thr 47292] *  DETAIL      NiPConnect
    [Thr 47292] *  SYSTEM CALL connect
    [Thr 47292] *  ERRNO       79
    [Thr 47292] *  ERRNO TEXT  A remote host refused an attempted connect operation.
    [Thr 47292] *  COUNTER     61
    [Thr 47292] *
    [Thr 47292] ********************************************************************
    [Thr 47292] ***LOG Q0I=> NiPConnect: connect (79: A remote host refused an attem
    pted connect operation.) [nixxi.cpp 2460]
    [Thr 47292] *** ERROR => NiPConnect: SiConnect failed for hdl 71 / sock 95
        (SI_ECONN_REFUSE/79; I4; ST; 172.16.204.56:3300) [nixxi.cpp    2460]
    [Thr 47292] *** ERROR => GwIConnect: GwConnect to sapsrqdb / sapgw00 failed (rc=
    NIECONN_REFUSED) [gwxx_mt.c    296]
    [Thr 47292] ***LOG S0T=> GwIConnect, GwConnect (-0010) [gwxx_mt.c    297]
    [Thr 47292] ***LOG S0R=> GwIConnect, GwConnect () [gwxx_mt.c    299]
    [Thr 47292] ***LOG S0S=> GwIConnect, GwConnect (sapgw00) [gwxx_mt.c    301]
    [Thr 47292] ***LOG S90=> SAP_CMREGTP3, GwIConnect ( 236) [r3cpic_mt.c  9624]
    [Thr 47292]
    [Thr 47292] *  ERROR       partner 'sapsrqdb:sapgw00' not reached
    [Thr 47292] *
    TIME        Tue Apr 15 15:51:50 2008
    [Thr 47292] *  RELEASE     700
    [Thr 47292] *  COMPONENT   NI (network interface)
    [Thr 47292] *  VERSION     38
    [Thr 47292] *  RC          -10
    [Thr 47292] *  MODULE      nixxi.cpp
    [Thr 47292] *  LINE        2460
    [Thr 47292] *  DETAIL      NiPConnect
    [Thr 47292] *  SYSTEM CALL connect
    [Thr 47292] *  ERRNO       79
    [Thr 47292] *  ERRNO TEXT  A remote host refused an attempted connect operation.
    [Thr 47292] *  COUNTER     63
    [Thr 47292] *
    [Thr 47292] ********************************************************************
    [Thr 47292] Tue Apr 15 15:51:52 2008
    [Thr 47292] ***LOG Q0I=> NiPConnect: connect (79: A remote host refused an attem
    pted connect operation.) [nixxi.cpp 2460]
    [Thr 47292] *** ERROR => NiPConnect: SiConnect failed for hdl 71 / sock 96
        (SI_ECONN_REFUSE/79; I4; ST; 172.16.204.56:3300) [nixxi.cpp    2460]
    [Thr 47292] *** ERROR => GwIConnect: GwConnect to sapsrqdb / sapgw00 failed (rc=
    NIECONN_REFUSED) [gwxx_mt.c    296]
    [Thr 47292] ***LOG S0T=> GwIConnect, GwConnect (-0010) [gwxx_mt.c    297]
    [Thr 47292] ***LOG S0R=> GwIConnect, GwConnect () [gwxx_mt.c    299]
    [Thr 47292] ***LOG S0S=> GwIConnect, GwConnect (sapgw00) [gwxx_mt.c    301]
    [Thr 47292] ***LOG S90=> SAP_CMREGTP3, GwIConnect ( 236) [r3cpic_mt.c  9624]
    [Thr 47292]
    [Thr 47292] *  ERROR       partner 'sapsrqdb:sapgw00' not reached
    [Thr 47292] *
    TIME        Tue Apr 15 15:51:52 2008
    [Thr 47292] *  RELEASE     700
    [Thr 47292] *  COMPONENT   NI (network interface)
    [Thr 47292] *  VERSION     38
    [Thr 47292] *  RC          -10
    [Thr 47292] *  MODULE      nixxi.cpp
    [Thr 47292] *  LINE        2460
    [Thr 47292] *  DETAIL      NiPConnect
    [Thr 47292] *  SYSTEM CALL connect
    [Thr 47292] *  ERRNO       79
    [Thr 47292] *  ERRNO TEXT  A remote host refused an attempted connect operation.
    [Thr 47292] *  COUNTER     65
    [Thr 47292] *
    [Thr 47292] ********************************************************************
    [Thr 47292] ***LOG Q0I=> NiPConnect: connect (79: A remote host refused an attem
    pted connect operation.) [nixxi.cpp 2460]
    [Thr 47292] *** ERROR => NiPConnect: SiConnect failed for hdl 71 / sock 96
        (SI_ECONN_REFUSE/79; I4; ST; 172.16.204.56:3300) [nixxi.cpp    2460]
    [Thr 47292] *** ERROR => GwIConnect: GwConnect to sapsrqdb / sapgw00 failed (rc=
    NIECONN_REFUSED) [gwxx_mt.c    296]
    [Thr 47292] ***LOG S0T=> GwIConnect, GwConnect (-0010) [gwxx_mt.c    297]
    [Thr 47292] ***LOG S0R=> GwIConnect, GwConnect () [gwxx_mt.c    299]
    [Thr 47292] ***LOG S0S=> GwIConnect, GwConnect (sapgw00) [gwxx_mt.c    301]
    [Thr 47292] ***LOG S90=> SAP_CMREGTP3, GwIConnect ( 236) [r3cpic_mt.c  9624]
    [Thr 47292]
    [Thr 47292] *  ERROR       partner 'sapsrqdb:sapgw00' not reached
    [Thr 47292] *
    TIME        Tue Apr 15 15:51:52 2008
    [Thr 47292] *  RELEASE     700
    [Thr 47292] *  COMPONENT   NI (network interface)
    [Thr 47292] *  VERSION     38
    [Thr 47292] *  RC          -10
    [Thr 47292] *  MODULE      nixxi.cpp
    [Thr 47292] *  LINE        2460
    [Thr 47292] *  DETAIL      NiPConnect
    [Thr 47292] *  SYSTEM CALL connect
    [Thr 47292] *  ERRNO       79
    [Thr 47292] *  ERRNO TEXT  A remote host refused an attempted connect operation.
    [Thr 47292] *  COUNTER     67
    [Thr 47292] *
    [Thr 47292] ********************************************************************
    [Thr 47292] ***LOG Q0I=> NiPConnect: connect (79: A remote host refused an attem
    pted connect operation.) [nixxi.cpp 2460]
    [Thr 47292] *** ERROR => NiPConnect: SiConnect failed for hdl 71 / sock 96
        (SI_ECONN_REFUSE/79; I4; ST; 172.16.204.56:3300) [nixxi.cpp    2460]
    [Thr 47292] *** ERROR => GwIConnect: GwConnect to sapsrqdb / sapgw00 failed (rc=
    NIECONN_REFUSED) [gwxx_mt.c    296]
    [Thr 47292] ***LOG S0T=> GwIConnect, GwConnect (-0010) [gwxx_mt.c    297]
    [Thr 47292] ***LOG S0R=> GwIConnect, GwConnect () [gwxx_mt.c    299]
    [Thr 47292] ***LOG S0S=> GwIConnect, GwConnect (sapgw00) [gwxx_mt.c    301]
    [Thr 47292] ***LOG S90=> SAP_CMREGTP3, GwIConnect ( 236) [r3cpic_mt.c  9624]
    [Thr 47292]
    [Thr 47292] *  ERROR       partner 'sapsrqdb:sapgw00' not reached
    [Thr 47292] *
    TIME        Tue Apr 15 15:51:52 2008
    [Thr 47292] *  RELEASE     700
    [Thr 47292] *  COMPONENT   NI (network interface)
    [Thr 47292] *  VERSION     38
    [Thr 47292] *  RC          -10
    [Thr 47292] *  MODULE      nixxi.cpp
    [Thr 47292] *  LINE        2460
    [Thr 47292] *  DETAIL      NiPConnect
    [Thr 47292] *  SYSTEM CALL connect
    [Thr 47292] *  ERRNO       79
    [Thr 47292] *  ERRNO TEXT  A remote host refused an attempted connect operation.
    [Thr 47292] *  COUNTER     69
    [Thr 47292] *
    [Thr 47292] ********************************************************************
    [Thr 47292] ***LOG Q0I=> NiPConnect: connect (79: A remote host refused an attem
    pted connect operation.) [nixxi.cpp 2460]
    [Thr 47292] *** ERROR => NiPConnect: SiConnect failed for hdl 71 / sock 96
        (SI_ECONN_REFUSE/79; I4; ST; 172.16.204.56:3300) [nixxi.cpp    2460]
    [Thr 47292] *** ERROR => GwIConnect: GwConnect to sapsrqdb / sapgw00 failed (rc=
    NIECONN_REFUSED) [gwxx_mt.c    296]
    [Thr 47292] ***LOG S0T=> GwIConnect, GwConnect (-0010) [gwxx_mt.c    297]
    [Thr 47292] ***LOG S0R=> GwIConnect, GwConnect () [gwxx_mt.c    299]
    [Thr 47292] ***LOG S0S=> GwIConnect, GwConnect (sapgw00) [gwxx_mt.c    301]
    [Thr 47292] ***LOG S90=> SAP_CMREGTP3, GwIConnect ( 236) [r3cpic_mt.c  9624]
    [Thr 47292]
    [Thr 47292] *  ERROR       partner 'sapsrqdb:sapgw00' not reached
    [Thr 47292] *
    TIME        Tue Apr 15 15:51:52 2008
    [Thr 47292] *  RELEASE     700
    [Thr 47292] *  COMPONENT   NI (network interface)
    [Thr 47292] *  VERSION     38
    [Thr 47292] *  RC          -10
    [Thr 47292] *  MODULE      nixxi.cpp
    [Thr 47292] *  LINE        2460
    [Thr 47292] *  DETAIL      NiPConnect
    [Thr 47292] *  SYSTEM CALL connect
    [Thr 47292] *  ERRNO       79
    [Thr 47292] *  ERRNO TEXT  A remote host refused an attempted connect operation.
    [Thr 47292] *  COUNTER     71
    [Thr 47292] *
    [Thr 47292] ********************************************************************
    [Thr 20306] Tue Apr 15 15:51:57 2008
    [Thr 20306] JHVM_RegisterNatives: registering methods in com.sap.bc.proj.jstartu
    p.sadm.ShmCache
    [Thr 67891] Tue Apr 15 15:52:01 2008
    [Thr 67891] JLaunchISetState: change state from [Stopping (5)] to [Stopped (6)]
    [Thr 67891] Tue Apr 15 15:52:03 2008
    [Thr 67891] JLaunchIExitJava: exit hook is called (rc = 0)
    [Thr 67891] SigISetIgnoreAction : SIG_IGN for signal 20
    [Thr 67891] JLaunchCloseProgram: good bye (exitcode = 0)
    sapsrqdb:piqadm>
    this is the content of dev_dispatcher.
    trc file: "/usr/sap/PIQ/DVEBMGS00/work/dev_dispatcher", trc level: 1, release: "
    700"
    node name   : ID2396800
    pid         : 934092
    system name : PIQ
    system nr.  : 00
    started at  : Tue Apr 15 09:32:34 2008
    arguments         :
              arg[00] : /usr/sap/PIQ/DVEBMGS00/exe/jlaunch
              arg[01] : pf=/usr/sap/PIQ/SYS/profile/PIQ_DVEBMGS00_sapsrqdb
              arg[02] : -DSAPINFO=PIQ_00_dispatcher
              arg[03] : pf=/usr/sap/PIQ/SYS/profile/PIQ_DVEBMGS00_sapsrqdb
              arg[04] : -DSAPSTART=1
              arg[05] : -DCONNECT_PORT=51973
              arg[06] : -DSAPSYSTEM=00
              arg[07] : -DSAPSYSTEMNAME=PIQ
              arg[08] : -DSAPMYNAME=sapsrqdb_PIQ_00
              arg[09] : -DSAPPROFILE=/usr/sap/PIQ/SYS/profile/PIQ_DVEBMGS00_sapsrqda
    rg[10] : -DFRFC_FALLBACK=ON
              arg[11] : -DFRFC_FALLBACK_HOST=localhost
    [Thr  1] Tue Apr 15 09:32:34 2008
    [Thr  1] *** WARNING => INFO: Unknown property [instance.box.number=PIQDVEBMGS00
    sapsrqdb] [jstartxx_mt. 841]
    [Thr  1] *** WARNING => INFO: Unknown property [instance.en.host=sapsrqdb] [jsta
    rtxx_mt. 841]
    [Thr  1] *** WARNING => INFO: Unknown property [instance.en.port=3201] [jstartxx
    _mt. 841]
    [Thr  1] *** WARNING => INFO: Unknown property [instance.system.id=0] [jstartxx_
    mt. 841]
    JStartupReadInstanceProperties: read instance properties [/usr/sap/PIQ/DVEBMGS00
    /j2ee/cluster/instance.properties]
    -> ms host    : sapsrqdb
    -> ms port    : 3901
    -> OS libs    : /usr/sap/PIQ/DVEBMGS00/j2ee/os_libs
    -> Admin URL  :
    -> run mode   : normal
    -> run action : NONE
    -> enabled    : yes
    Used property files
    -> files [00] : /usr/sap/PIQ/DVEBMGS00/j2ee/cluster/instance.properties
    Instance properties
    -> ms host    : sapsrqdb
    -> ms port    : 3901
    -> os libs    : /usr/sap/PIQ/DVEBMGS00/j2ee/os_libs
    -> admin URL  :
    -> run mode   : normal
    -> run action : NONE
    -> enabled    : yes
    Bootstrap nodes
    -> [00] bootstrap            : /usr/sap/PIQ/DVEBMGS00/j2ee/cluster/instance.prop
    erties
    -> [01] bootstrap_ID2396800  : /usr/sap/PIQ/DVEBMGS00/j2ee/cluster/instance.prop
    erties
    -> [02] bootstrap_ID2396850  : /usr/sap/PIQ/DVEBMGS00/j2ee/cluster/instance.prop
    erties
    Worker nodes
    -> [00] ID2396800            : /usr/sap/PIQ/DVEBMGS00/j2ee/cluster/instance.prop
    erties
    -> [01] ID2396850            : /usr/sap/PIQ/DVEBMGS00/j2ee/cluster/instance.prop
    erties
    [Thr  1] JLaunchRequestQueueInit: create named pipe for ipc
    [Thr  1] JLaunchRequestQueueInit: create pipe listener thread
    [Thr 258] JLaunchRequestFunc: Thread 258 started as listener thread for np messa
    ges.
    [Thr 515] WaitSyncSemThread: Thread 515 started as semaphore monitor thread.
    [Thr  1] SigISetDefaultAction : default handling for signal 20
    [Thr  1] NiInit3: NI already initialized; param 'maxHandles' ignored (1;202)
    [Thr  1] CPIC (version=700.2006.09.13)
    [Thr  1] [Node: dispatcher] java home is set by profile parameter
            Java Home: /usr/java14_64
    [Thr  1] JStartupICheckFrameworkPackage: can't find framework package /usr/sap/P
    IQ/DVEBMGS00/exe/jvmx.jar
    JStartupIReadSection: read node properties [ID2396800]
    -> node name          : dispatcher
    -> node type          : dispatcher
    -> node execute       : yes
    -> jlaunch parameters :
    -> java path          : /usr/java14_64
    -> java parameters    : -Xj9 -Xgcpolicy:gencon -verbose:gc -Xmn70M -Djava.securi
    ty.policy=.\java.policy -Djava.security.egd=file:/dev/urandom -Djco.jarm=1
    -> java vm version    : J2RE 1.4.2 IBM J9 2.3 AIX ppc64-64 j9ap64142ifx-20070920
    (JIT enabled)
    -> java vm vendor     : IBM J9 VM (IBM Corporation)
    -> java vm type       : server
    -> java vm cpu        : ppc64
    -> heap size          : 200M
    -> init heap size     : 200M
    -> root path          : /usr/sap/PIQ/DVEBMGS00/j2ee/cluster/dispatcher
    -> class path         : ./bin/boot/boot.jar:./bin/system/bytecode.jar:.
    -> OS libs path       : /usr/sap/PIQ/DVEBMGS00/j2ee/os_libs
    -> main class         : com.sap.engine.boot.Start
    -> framework class    : com.sap.bc.proj.jstartup.JStartupFramework
    -> registr. class     : com.sap.bc.proj.jstartup.JStartupNatives
    -> framework path     : /usr/sap/PIQ/DVEBMGS00/exe/jstartup.jar:/usr/sap/PIQ/DVE
    BMGS00/exe/jvmx.jar
    -> shutdown class     : com.sap.engine.boot.Start
    -> parameters         :
    -> debuggable         : no
    -> debug mode         : no
    -> debug port         : 50000
    -> shutdown timeout   : 120000
    [Thr  1] JLaunchISetDebugMode: set debug mode [no]
    [Thr 772] JLaunchIStartFunc: Thread 772 started as Java VM thread.
    JHVM_LoadJavaVM: VM Arguments of node [dispatcher]
    -> stack   : 1048576 Bytes
    -> arg[  0]: exit
    -> arg[  1]: abort
    -> arg[  2]: vfprintf
    -> arg[  3]: -Xj9
    -> arg[  4]: -Xgcpolicy:gencon
    -> arg[  5]: -verbose:gc
    -> arg[  6]: -Xmn70M
    -> arg[  7]: -Djava.security.policy=.\java.policy
    -> arg[  8]: -Djava.security.egd=file:/dev/urandom
    -> arg[  9]: -Djco.jarm=1
    -> arg[ 10]: -Dsys.global.dir=/usr/sap/PIQ/SYS/global
    -> arg[ 11]: -Dapplication.home=/usr/sap/PIQ/DVEBMGS00/exe
    -> arg[ 12]: -Djava.class.path=/usr/sap/PIQ/DVEBMGS00/exe/jstartup.jar:/usr/sap/
    PIQ/DVEBMGS00/exe/jvmx.jar:./bin/boot/boot.jar:./bin/system/bytecode.jar:.
    -> arg[ 13]: -Djava.library.path=/usr/java14_64/jre/bin:/usr/java14_64/jre/bin:/
    usr/java14_64/jre/bin/classic:/usr/java14_64/jre/bin:/usr/sap/PIQ/DVEBMGS00/exe:
    /usr/sap/PIQ/DVEBMGS00/exe:/usr/sap/PIQ/DVEBMGS00/exe:/software/install/PI/sapin
    st_exe.315468.1206236735:/usr/sap/PIQ/SYS/exe/run:/oracle/client/10x_64/instantc
    lient:/usr/java14_64/jre/bin/j9vm:/usr/sap/PIQ/DVEBMGS00/exe::/usr/lib:/usr/sap/
    PIQ/DVEBMGS00/j2ee/os_libs:/usr/sap/PIQ/DVEBMGS00/exe:/usr/sap/PIQ/DVEBMGS00/exe
    :/usr/sap/PIQ/DVEBMGS00/exe:/usr/lib:/lib:/usr/sap/PIQ/SYS/exe/run:/oracle/clien
    -> arg[ 14]: -Dmemory.manager=200M
    -> arg[ 15]: -Xmx200M
    -> arg[ 16]: -Xms200M
    -> arg[ 17]: -DLoadBalanceRestricted=no
    -> arg[ 18]: -Djstartup.mode=JCONTROL
    -> arg[ 19]: -Djstartup.ownProcessId=934092
    -> arg[ 20]: -Djstartup.ownHardwareId=F1751266886
    -> arg[ 21]: -Djstartup.whoami=dispatcher
    -> arg[ 22]: -Djstartup.debuggable=no
    -> arg[ 23]: -DSAPINFO=PIQ_00_dispatcher
    -> arg[ 24]: -DSAPSTART=1
    -> arg[ 25]: -DCONNECT_PORT=51973
    -> arg[ 26]: -DSAPSYSTEM=00
    -> arg[ 27]: -DSAPSYSTEMNAME=PIQ
    -> arg[ 28]: -DSAPMYNAME=sapsrqdb_PIQ_00
    -> arg[ 29]: -DSAPPROFILE=/usr/sap/PIQ/SYS/profile/PIQ_DVEBMGS00_sapsrqdb
    -> arg[ 30]: -DFRFC_FALLBACK=ON
    -> arg[ 31]: -DFRFC_FALLBACK_HOST=localhost
    -> arg[ 32]: -DSAPSTARTUP=1
    -> arg[ 33]: -DSAPSYSTEM=00
    -> arg[ 34]: -DSAPSYSTEMNAME=PIQ
    -> arg[ 35]: -DSAPMYNAME=sapsrqdb_PIQ_00
    -> arg[ 36]: -DSAPDBHOST=sapsrqdb
    -> arg[ 37]: -Dj2ee.dbhost=sapsrqdb
    [Thr 772] Tue Apr 15 09:32:35 2008
    [Thr 772] JHVM_LoadJavaVM: Java VM created OK.
    JHVM_BuildArgumentList: main method arguments of node [dispatcher]
    [Thr 4114] Tue Apr 15 09:32:42 2008
    [Thr 4114] JHVM_RegisterNatives: registering methods in com.sap.bc.krn.perf.Perf
    Times
    [Thr 4114] JHVM_RegisterNatives: registering methods in com.sap.bc.proj.jstartup
    .JStartupFramework
    [Thr 4114] JLaunchISetClusterId: set cluster id 2396800
    [Thr 4114] JLaunchISetState: change state from [Initial (0)] to [Waiting for sta
    rt (1)]
    [Thr 4114] JLaunchISetState: change state from [Waiting for start (1)] to [Start
    ing (2)]
    [Thr 11054] Tue Apr 15 09:32:48 2008
    [Thr 11054] JLaunchISetTelnetPort: set telnet port 50008
    [Thr 11054] JLaunchISetTelnetPort: set telnet port 50008
    [Thr 8998] Tue Apr 15 09:32:49 2008
    [Thr 8998] JLaunchISetP4Port: set p4 port 50004
    [Thr 13881] Tue Apr 15 09:32:52 2008
    [Thr 13881] JLaunchISetHttpPort: set http port 50000
    [Thr 13881] JLaunchISetHttpsPort: set https port 50001
    [Thr 4114] Tue Apr 15 09:32:56 2008
    [Thr 4114] JLaunchISetState: change state from [Starting (2)] to [Running (3)]
    [Thr 11568] Tue Apr 15 09:33:26 2008
    [Thr 11568] JLaunchISetP4Port: set p4 port 50004
    [Thr 13367] Tue Apr 15 09:35:18 2008
    [Thr 13367] JLaunchISetHttpPort: set http port 50000
    [Thr 13367] JLaunchISetHttpsPort: set https port 50001
    [Thr 258] Tue Apr 15 13:48:51 2008
    [Thr 258] JLaunchRequestFunc: receive command:17, argument:0 from pid:1482990
    [Thr 258] JLaunchIShutdownInvoke: set shutdown interval (stop:1208285331/end:120
    8285451/TO:120)
    [Thr 258] JLaunchProcessCommand: Invoke VM Shutdown
    [Thr 258] JHVM_FrameworkShutdownDirect: invoke direct shutdown
    [Thr 8563] JLaunchISetState: change state from [Running (3)] to [Waiting for sto
    p (4)]
    [Thr 8563] JLaunchISetState: change state from [Waiting for stop (4)] to [Stoppi
    ng (5)]
    [Thr 8998] JLaunchISetHttpPort: set http port 50000
    [Thr 8998] JLaunchISetHttpsPort: set https port 50001
    [Thr 10797] JLaunchISetHttpPort: set http port 50000
    [Thr 10797] JLaunchISetHttpsPort: set https port 50001
    [Thr 11825] JLaunchISetP4Port: set p4 port 50004
    [Thr 12853] Tue Apr 15 13:48:52 2008
    [Thr 12853] JLaunchISetP4Port: set p4 port 50004
    [Thr 10026] JLaunchISetP4Port: set p4 port 50004
    [Thr 9769] Tue Apr 15 13:48:53 2008
    [Thr 9769] JLaunchISetHttpsPort: set https port 50001
    [Thr 9769] JLaunchISetHttpPort: set http port 50000
    [Thr 6942] Tue Apr 15 13:48:58 2008
    [Thr 6942] JLaunchISetTelnetPort: set telnet port 50008
    [Thr 8998] Tue Apr 15 13:48:59 2008
    [Thr 8998] JLaunchISetHttpPort: set http port 50000
    [Thr 8563] Tue Apr 15 13:49:02 2008
    [Thr 8563] JLaunchISetState: change state from [Stopping (5)] to [Stopped (6)]
    [Thr 8563] JLaunchIExitJava: exit hook is called (rc = 0)
    [Thr 8563] SigISetIgnoreAction : SIG_IGN for signal 20
    [Thr 8563] JLaunchCloseProgram: good bye (exitcode = 0)
    this the information that i have.

  • New Bie help with MySQL & servlet

    Hi,
    I am trying to execute a small action... some how my code does not work. All it shows is a blank page with no error....
    Can any one help me to optimize this code so that it works?
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package oneword;
    import com.mysql.jdbc.Connection;
    import com.mysql.jdbc.Statement;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.util.Random;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class Register extends HttpServlet {
        private String name = null;
        private String emailID = null;
        private String nameDB = "jdbc:mysql://localhost:3306/register";
        private String mysqlUser = "root";
        private String mysqlPassword = "abc";
        private String mySqlJdbcDriver = "com.mysql.jdbc.Driver";
        private Connection conn = null;
         * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
         * @throws ServletException if a servlet-specific error occurs
         * @throws IOException if an I/O error occurs
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException, ClassNotFoundException, SQLException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            name = request.getParameter("_name");
            emailID = request.getParameter("_email");
            try {
                Random generator = new Random();
                int activationPassword = generator.nextInt(100000);
                Class.forName(mySqlJdbcDriver);
                conn = (Connection) DriverManager.getConnection(nameDB,mysqlUser,mysqlPassword);
                Statement statement = (Statement) conn.createStatement();
                String sqlCommand = "INSERT INTO userdata(name, email, validation, " +
                        "banned, activatepassword, password)values("+name+", "+emailID+", 0, 0,"+activationPassword+", 'ddd')";
                statement.executeQuery(sqlCommand);
                out.println(name);
                out.println("<br>"+emailID);
                out.println("rows affected:");
                conn.close();
            } catch (SQLException ex) {
            // handle any errors
            System.out.println("SQLException: " + ex.getMessage());
            System.out.println("SQLState: " + ex.getSQLState());
            System.out.println("VendorError: " + ex.getErrorCode());
            } finally {
                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
         * @throws ServletException if a servlet-specific error occurs
         * @throws IOException if an I/O error occurs
        @Override
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            try {
                processRequest(request, response);
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);
            } catch (SQLException ex) {
                Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);
         * Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
         * @throws ServletException if a servlet-specific error occurs
         * @throws IOException if an I/O error occurs
        @Override
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            try {
                processRequest(request, response);
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);
            } catch (SQLException ex) {
                Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);
    }Thank you

    A blank page usually indicate that an exception is been thrown but cannot be displayed because the response is already started/committed/processed. Just read the appserver's logs as usual for the details.
    Your servlet class does way too much. You're mingling all the processing steps together in one class. This is simply asking for trouble. Use a DAO class for accessing the DB. Use a JSP file for presentation. Use a business object to process the input/output data. Use a servlet for controlling the request. To start off, you may get some ideas out of this article and the JSP/Servlet follow-up: [http://balusc.blogspot.com/2008/07/dao-tutorial-data-layer.html].
    Oh, your JDBC code is not safe against SQL injection attacks either.

  • Help with running servlet with jakarta tomcat

    I had recently created a couple of java servlets and wanted to run them. I had put the .class files in Tomcat 4.1\webapps\Root\ then typed in http://localhost:8080/ then the servlet in the web browser. Here was the error page copied and pasted. If I put http://localhost:8080/servlet.class instead of http://localhost:8080/servlet I get a popup saying do I want to download the .class file. Theres probley a simple solution to this. Anyone know of any free hosts that will host servlets for free?
    HTTP Status 404 - /servlet
    type Status report
    message /servlet
    description The requested resource (/servlet) is not available.
    Apache Tomcat/4.1.18
    Thanks in advance
    George

    Hi I have the compiler jdk1.1.8 and wanted to upgrade my version. I downloaded the j2sdk1.4.1_01. I have the classpath set and everything. When I attempt to compile my java servlet it gives me an error but when I compile it with jdk1.1.8 it works.
    Isn't jakarta-tomcat-3.2.3 different compared the the one I have jakarta-tomcat4.1.18? Anyway thats what I read somewhere. The instructions you gave me do you think they are different because of us having different verions? I don't know if this is normal but whenever I startup my computer it just automaticly starts up tomcat server so when I put http://localhost:8080 it goes to the page saying I setup tomcat successfully. When I try to shutdown it doesn't do it.
    About the classpath. I thought i'm supposed to only put one path. So if I were to do that it would look like path set TOMCAT_HOME=C:\jdk1.1.8\Program Files\Apache Group\Tomcat 4.1 Thats how I would set it on my computer. I already installed and ran tomcat. I think your right I need to check the documentation correctly.
    Thanks in advance
    George

  • Help With Integrating Servlet and JSP Page?

    Hello There
    --i made jsp page that contain name and description fields and add button
    --and i made servlet that contain the code to insert name and description in the database
    --and i want to make that when the user hit the add button
    -->the entered name and description is sent to the servlet
    and the servlet sent them to database?
    here's what i 've done:
    the jsp code:
    <html:html locale="true">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>
            Categories Page
           </title>
            <html:base/>
        </head>
        <body style="background-color: white">
        <form action="jpage.jsp" method="get">
            <h1>
                <center>
    categories Operations
                </center>
            </h1>
            <h3>
                 <label>Name</label>
            <input type="text" name="name" value="" size="10" />
                 <label>Description</label>
             <input type="text" name="description" value="" size="10" />
             <input type="submit" value="Add" name="button" />
           </h3>
       </form>
        </body>
    </html:html>the servlet code:
    import java.io.*;
    import java.util.Enumeration;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.net.*;
    class NewServlet1 extends HttpServlet{
         Connection conn;
         private ServletConfig config;
    public void init(ServletConfig config)
      throws ServletException{
         this.config=config;
    public void service (HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
       HttpSession session = req.getSession(true);
       res.setContentType("text/html");
    try{
         Class.forName("com.mysql.jdbc.Driver");
       conn = DriverManager.getConnection("jdbc:mysql://localhost/struts", "root", "");
         PreparedStatement ps;
       ps = conn.prepareStatement ("INSERT INTO categories (Name, Description) VALUES(?,?)");
          ps.setString (1, "aa");
          ps.setString (3, "bb");
          ps.executeUpdate();
          ps.close();
          conn.close();
      }catch(Exception e){ e.getMessage();}
      public void destroy(){}
    }

    The JSP Code:
    <html:html locale="true">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>
            Categories Page
           </title>
            <html:base/>
        </head>
        <body style="background-color: white">
        <form action="actionServlet.do?action=Additem" method="*post*">
            <h1>
                <center>
    categories Operations
                </center>
            </h1>
            <h3>
                 <label>Name</label>
            <input type="text" name="name" value="" size="10" />
                 <label>Description</label>
             <input type="text" name="description" value="" size="10" />
             <input type="button" value="Submit">
           </h3>
       </form>
        </body>
    </html:html>The Servlet Code:
    import java.io.*;
    import java.util.Enumeration;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.net.*;
    public class NewServlet1 extends HttpServlet implements SingleThreadModel {
        public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException {
            doPost(request,response);
        public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException {
              String action = request.getParameter("action"); // action = "Additem"
              if (action.equals("Additem")) {
                   String name = request.getParameter("name");
                   String description = request.getParameter("description");
                         RequestDispatcher reqDisp = null;
                   try{
                  Connection conn;
                  PreparedStatement ps;
         Class.forName("com.mysql.jdbc.Driver");
       conn = DriverManager.getConnection("jdbc:mysql://localhost/struts", "root", "");
       ps = conn.prepareStatement ("INSERT INTO categories (Name, Description) VALUES(?,?)");
          ps.setString (1, name);
          ps.setString (3, description);
          ps.executeUpdate();
          ps.close();
          conn.close();
          reqDisp= request.getRequestDispatcher("./index.jsp");
          reqDisp.forward(request, response);
                   catch (Exception ex){
                        System.out.println("Error: "+ ex);
    }The web.xml code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
        <servlet>
            <servlet-name>action</servlet-name>
            <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
            <init-param>
                <param-name>config</param-name>
                <param-value>/WEB-INF/struts-config.xml</param-value>
            </init-param>
            <init-param>
                <param-name>debug</param-name>
                <param-value>2</param-value>
            </init-param>
            <init-param>
                <param-name>detail</param-name>
                <param-value>2</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>
            </servlet>
        <servlet>
            <servlet-name>NewServlet1</servlet-name>
            <servlet-class>NewServlet1</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>action</servlet-name>
            <url-pattern>*.do</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>NewServlet1</servlet-name>
            <url-pattern>/NewServlet1</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
            </welcome-file-list>
            <servlet>
         <servlet-name>actionServlet</servlet-name>
         <servlet-class>com.test.servlet.NewServlet1</servlet-class>
    </servlet>
    <servlet-mapping>
         <servlet-name>actionServlet</servlet-name>
         <url-pattern>*.do</url-pattern>
    </servlet-mapping>
        </web-app>

  • Please help with J2EE

    Hi,
    I'm trying to get started writing J2EE applications. I've downloaded the
    Mars IDE for J2EE, Java SE 8, MySQL, & Tomcat 6.0. Do I need anything
    else to get started?
    Also I'm getting lost in the documentation. Can anyone recommend
    any simple J2EE getting started tutorials that will work on MARS?
    Thanx in advance.

    On 07/23/2015 12:36 AM, Ralph Lecessi wrote:
    > Hi,
    >
    > I'm trying to get started writing J2EE applications. I've downloaded the
    > Mars IDE for J2EE, Java SE 8, MySQL, & Tomcat 6.0. Do I need anything
    > else to get started?
    >
    > Also I'm getting lost in the documentation. Can anyone recommend
    > any simple J2EE getting started tutorials that will work on MARS?
    >
    > Thanx in advance.
    Certainly. The best tutorials I've found are found at
    http://www.vogella.de/tutorials
    Best of luck to you!

  • Need Help with J2EE Connector Architecture!! Please!

    Scenario:
    We are trying to establish connectivity to a CTG using the new JCA connector specifications.
    We have our input in the form of a string but the Interaction.execute(ioRecord, ioRecord object specifies record object as parameters.
    How do we create a record that correctly represents our current input string?
    Is there a predetermined record format that we must use for out connection or can we create our own record?
    If we can create our own record how is it converted and padded properly for a byte stream that is required by the CTG?

    Send a message to [email protected] they help answer tough questions for a fee.

  • Running Servlet with J2EE Web Server

    Hi experts
    My web server is J2EE. I have compiled the servlet classes and have put them in the web-inf/classes directory. I have also declared the servlets in the web.xml file in the web-inf directory.
    When I run this, it gives error HTTP Status 404 - /fijidirectory.
    Experts can you help me with this pliz.
    Deepak

    Now the code looks like this.
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      <display-name>J2EE Servlet Config</display-name> 
      <servlet>
        <servlet-name>dirinterface</servlet-name>
        <servlet-class>DirectoriesInterface.DirInterface</servlet-class>
      </servlet>
      <servlet>
        <servlet-name>dispplaydirinfo</servlet-name>
        <servlet-class>DirectoriesInterface.DispplayDirInfo</servlet-class>
      </servlet>
      <servlet>
        <servlet-name>fijidirmain</servlet-name>
        <servlet-class>DirectoriesInterface.FijiDirMain</servlet-class>
      </servlet>
      <servlet>
        <servlet-name>whitedirinterface</servlet-name>
        <servlet-class>DirectoriesInterface.whiteDirInterface</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>dirinterface</servlet-name>
        <url-pattern>/FijiDirectory</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>dispplaydirinfo</servlet-name>
        <url-pattern>/dirInfo</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>fijidirmain</servlet-name>
        <url-pattern>/fiiidirectory</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>whitedirinterface</servlet-name>
        <url-pattern>/whfd</url-pattern>
      </servlet-mapping>
    </web-app>
    The url that I am using to access the system is: http://localhost:8080/whfd

  • Help with Servlets!!

    Hi all,
    I need help with Java and Jsp. Here are the specs:
    1. An HTML web form that contains info about a customer: name, address, telephone number.
    2. When the "Submit" button is clicked, the information will go directly into an Oracle database table named "customer".
    Where should I start?? So far, I have created the HTML web form. So what i need is to write a servlet that will take the data from the web form and insert that into the Oracle table. If you have any solutions to my problem, please let me know. Thanks a lot in advance.

    <%@ page language="java" import="java.sql.*" %>
    <html>
    <head>
    <title>
    Customer
    </title>
    </head>
    <body>
    <%!
    java.sql.Connection con;
    java.sql.PreparedStatement pstmt;
    java.sql.ResultSet rs;
    javax.servlet.http.HttpServlet request;
    String name,address;
    int phone;
    int i;
    %>
    <%
         try {     
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = java.sql.DriverManager.getConnection
    ("jdbc:odbc:<DSN name>","scott","tiger");
    %>
    <% } catch(Exception e){ System.out.println(e.getMessage()); } %>
    <%
    name = request.getParameter("name");
    address = request.getParameter("address");
    phone = Integer.parseInt(request.getParameter("phone"));
    pstmt=con.prepareStatement("insert into <table name> values(?,?,?)");
    pstmt.setString(1,name);
    pstmt.setString(2,address);
    pstmt.setInt(3,phone);
    i=pstmt.executeUpdate();
    %>
    </body>
    </html>
    1. create a dsn connecting oracle, using ODBC from control panel
    2. name the text fields in the html page as "name","address","phone"
    3. enter the table name you created in oracle in place of <table name>
    I hope this should work , let me know .......
    bye
    vamsee

  • Please help with SSL POST: Servlet returns Error 500

    I am struggling for many days to get a Java program to log in to an SSL page. The program is supposed to track ADSL usage statistics from https://secure.telkomsa.net/titracker/, but I never seem to get around Server returned Error 500.
    Could anyone please help me understand what I am doing wrong by looking at the method I used. (It seems on the server side it is a jsp servlet that handles authentication).
    Any help is deeply appreciated!
    I copy-paste the method directly from NetBeans:
    CODE>
    void connectHTTPS(String url){
    try {
    URL page = new URL(url); // login page necessary to get a jsp session cookie
    //------------ SET UP SSL - is it right?
    System.setProperty("java.protocol.handler.pkgs",
    "com.sun.net.ssl.internal.www.protocol");
    try {
    //if we have the JSSE provider available,
    //and it has not already been
    //set, add it as a new provide to the Security class.
    final Class clsFactory = Class.forName("com.sun.net.ssl.internal.ssl.Provider");
    if( (null != clsFactory) && (null == Security.getProvider("SunJSSE")) )
    Security.addProvider((Provider)clsFactory.newInstance());
    } catch( ClassNotFoundException cfe ) {
    throw new Exception("Unable to load the JSSE SSL stream handler." +
    "Check classpath." + cfe.toString());
    URLConnection urlc = page.openConnection();
    urlc.setDoInput(true);
    *Get the session id cookie set by the TelkomInternet java server
    String cookie = urlc.getHeaderField("Set-Cookie");
    //textpane.setText(totextpane);
    textpane.setText(cookie);
    //---------------- form an auth request and post it with the cookie
    String postdata =URLEncoder.encode("ID_Field","UTF-8")+"="+URLEncoder.encode("myusrname","UTF-8")+"&"+URLEncoder.encode("PW_Field","UTF-8")+"="+URLEncoder.encode("mypwd","UTF-8")+"&"+URLEncoder.encode("confirm","UTF-8")+"="+URLEncoder.encode("false","UTF-8");
    // set the servlet that handles authentication as target
    URL page2 = new URL("https://secure.telkomsa.net/titracker/servlet/LoginServlet");
    // cast to httpConn to enable setRequestMethod()
    HttpURLConnection urlc2 = (HttpURLConnection)page2.openConnection();
    // formulate request with POST data urlc2.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
    urlc2.setRequestMethod("POST"); // experimental
    urlc2.setRequestProperty("Content-Length",""+postdata.length());
    urlc2.setRequestProperty("User-Agent","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)");
    urlc2.setRequestProperty("Accept-Language","en-us");
    urlc2.setUseCaches(false);
    urlc2.setDoOutput(true);
    urlc2.setDoInput(true);
    urlc2.setFollowRedirects(true); // ??
    //send cookies
    urlc2.setRequestProperty("Set-Cookie", cookie); // or "Cookie" - doesn't work either
    //write other data
    PrintWriter out = new PrintWriter(urlc2.getOutputStream());
    out.print(postdata); // username and password here
    out.flush();
    out.close();
    //---------------- get the authenticated page with real ADSL statistics
    BufferedReader br = new BufferedReader(new InputStreamReader(urlc2.getInputStream()));
    String totextpane = "";
    String buffer = "";
    while (buffer != null) {
    try {
    totextpane = totextpane + "\n" + buffer;
    buffer = br.readLine();
    } catch (IOException ioe) {
    ioe.printStackTrace();
    break;
    textpane.setText(totextpane);
    } catch (Exception ex) {
    System.err.println(ex.getMessage());
    ---- END CODE---
    Thank you very much for any attempt at helping with this problem!

    I am struggling for many days to get a Java program to log in to an SSL page. The program is supposed to track ADSL usage statistics from https://secure.telkomsa.net/titracker/, but I never seem to get around Server returned Error 500.
    Could anyone please help me understand what I am doing wrong by looking at the method I used. (It seems on the server side it is a jsp servlet that handles authentication).
    Any help is deeply appreciated!
    I copy-paste the method directly from NetBeans:
    CODE>
    void connectHTTPS(String url){
    try {
    URL page = new URL(url); // login page necessary to get a jsp session cookie
    //------------ SET UP SSL - is it right?
    System.setProperty("java.protocol.handler.pkgs",
    "com.sun.net.ssl.internal.www.protocol");
    try {
    //if we have the JSSE provider available,
    //and it has not already been
    //set, add it as a new provide to the Security class.
    final Class clsFactory = Class.forName("com.sun.net.ssl.internal.ssl.Provider");
    if( (null != clsFactory) && (null == Security.getProvider("SunJSSE")) )
    Security.addProvider((Provider)clsFactory.newInstance());
    } catch( ClassNotFoundException cfe ) {
    throw new Exception("Unable to load the JSSE SSL stream handler." +
    "Check classpath." + cfe.toString());
    URLConnection urlc = page.openConnection();
    urlc.setDoInput(true);
    *Get the session id cookie set by the TelkomInternet java server
    String cookie = urlc.getHeaderField("Set-Cookie");
    //textpane.setText(totextpane);
    textpane.setText(cookie);
    //---------------- form an auth request and post it with the cookie
    String postdata =URLEncoder.encode("ID_Field","UTF-8")+"="+URLEncoder.encode("myusrname","UTF-8")+"&"+URLEncoder.encode("PW_Field","UTF-8")+"="+URLEncoder.encode("mypwd","UTF-8")+"&"+URLEncoder.encode("confirm","UTF-8")+"="+URLEncoder.encode("false","UTF-8");
    // set the servlet that handles authentication as target
    URL page2 = new URL("https://secure.telkomsa.net/titracker/servlet/LoginServlet");
    // cast to httpConn to enable setRequestMethod()
    HttpURLConnection urlc2 = (HttpURLConnection)page2.openConnection();
    // formulate request with POST data urlc2.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
    urlc2.setRequestMethod("POST"); // experimental
    urlc2.setRequestProperty("Content-Length",""+postdata.length());
    urlc2.setRequestProperty("User-Agent","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)");
    urlc2.setRequestProperty("Accept-Language","en-us");
    urlc2.setUseCaches(false);
    urlc2.setDoOutput(true);
    urlc2.setDoInput(true);
    urlc2.setFollowRedirects(true); // ??
    //send cookies
    urlc2.setRequestProperty("Set-Cookie", cookie); // or "Cookie" - doesn't work either
    //write other data
    PrintWriter out = new PrintWriter(urlc2.getOutputStream());
    out.print(postdata); // username and password here
    out.flush();
    out.close();
    //---------------- get the authenticated page with real ADSL statistics
    BufferedReader br = new BufferedReader(new InputStreamReader(urlc2.getInputStream()));
    String totextpane = "";
    String buffer = "";
    while (buffer != null) {
    try {
    totextpane = totextpane + "\n" + buffer;
    buffer = br.readLine();
    } catch (IOException ioe) {
    ioe.printStackTrace();
    break;
    textpane.setText(totextpane);
    } catch (Exception ex) {
    System.err.println(ex.getMessage());
    ---- END CODE---
    Thank you very much for any attempt at helping with this problem!

  • Please help to upload with java servlet

    I want to install a java servlet uploader on my web site and i try to do it many times but i can't beacuse i dont know what are the essentials that should be found on the server to install java servlet in right way ..
    so please help me to do this .. and tell me what i need to upload files correctly with java servlet .
    any help will be appreciated ..
    thank you !

    Hello newton ..
    I only want to know what are the requirments that let me use the java servlet on linux system .. because i want use an uploader using java servlet ..
    thank u newton ..
    any help will be appreciated

  • Help with a simple login servlet

    I appreciate any help and assistance you all can give. I'm in an Intro to Java class on Georgia State and have an issue with this servlet I'm building. We're developing a login system where we have an http form pass a studentid and pin number to a servlet, then the servlet will match those inputs against the result set from an access database query using sql. I keep getting an error that will be posted below and I can't see any reason why I'd be getting it. Again any help would be appreciated. Here's the info:
    import java.io.*;
    import java.util.*;
    import java.sql.*; // for JDBC
    import javax.servlet.*; // for Servlet
    import javax.servlet.http.*; // for HttpServlet
    public class StudentLogin extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException{
              //get parameters
                        String aStudentId = (String) request.getParameter("studentid");
              String aPin = (String) request.getParameter("pin");
              //define the data source
                        String url = "jdbc:odbc:CIS3270Project";
                        Connection con = null;
                        Statement stmt;
                        String query;
              ResultSet rs = null;
                        //exception handling
                        try {
                        //load the driver -throws ClassNotFoundException
                        Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
                        catch (ClassNotFoundException cnfe) {
                        System.err.println (cnfe);
         try {
                        con = DriverManager.getConnection (url, "my-user", "my-passwd");
                        // create sql statement
                        stmt = con.createStatement ();
                        query = "SELECT * FROM STUDENT WHERE StudentID='" + aStudentId + "'";
                        // run the query
                        rs = stmt.executeQuery (query);
                        //get data from result set
                             rs.next();
                             String studentId = rs.getString("StudentID");
                             String pin = rs.getString("PIN");
                             System.out.println(studentId);
                             System.out.println(pin);
                   catch (SQLException ex) {
                        ex.printStackTrace();
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
              //compare form data to result set
    if(aPin.equals(pin)){
                   System.out.println("Login Successful");
              else{
                   System.out.println("Login Failed");
    The error is as follows:
    StudentLogin.java:58: cannot resolve symbol
    symbol : variable pin
    location: class StudentLogin
    if(aPin.equals(pin)){
    ^
    1 error
    I've declared pin and there should be no issue with it using it as an argument in this string comparison. Thanks for any light you can shed on this.
    -Matt

    Alright, I've broken up the code and made it more modular. Here's my code for my Authenticator class followed by the code in the servlet.
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    public class Authenticator{
         //define the data source
         Connection con = null;
         Statement stmt;
         String query;
    ResultSet rs = null;
         public void loadDb(){
              try {
                   //load the driver -throws ClassNotFoundException
                   Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
              catch (ClassNotFoundException cnfe) {
                   System.err.println (cnfe);
              try {
                   con = DriverManager.getConnection ("jdbc:odbc:CIS3270Project", "my-user", "my-passwd");
              catch (SQLException ex) {
                   ex.printStackTrace();
         public void queryDb(String aStudentId){
              try {
                   // create sql statement
                   stmt = con.createStatement ();
                   query = "SELECT * FROM STUDENT WHERE StudentID='" + aStudentId + "'";
                   // run the query
                   rs = stmt.executeQuery (query);
              catch (SQLException xe) {
                   xe.printStackTrace();
              try {
                   //get data from result set
                   rs.next();
                   String studentId = rs.getString("StudentId");
                   String pin = rs.getString("PIN");
              catch (SQLException x) {
                   x.printStackTrace();
         public void isValid(String aPin){
              if(pin.equals(aPin)){
                   System.out.println("Login Successful");
              else{
                   System.out.println("Login Failed");
    Here's the servlet:
    import java.io.*;
    import java.util.*;
    import java.sql.*; // for JDBC
    import javax.servlet.*; // for Servlet
    import javax.servlet.http.*; // for HttpServlet
    public class StudentLogin extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException{
    //get parameters
              String aStudentId = (String) request.getParameter("studentid");
    String aPin = (String) request.getParameter("pin");
         Authenticator a = new Authenticator();
         a.loadDb();
         a.queryDb(aStudentId);
         a.isValid(aPin);
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    //bunch of HTML output shit goes here
    I keep getting an error of cannot resolve symbol in the isValid method. It can't resolve the variable 'pin' from the database query. Does try limit the scope of that variable to only inside that try statement? Thanks for any help you guys can give.

Maybe you are looking for

  • End routine  not workind when DSO Activated

    I have code in End routine of the transformation to populate a date field (from sales header to  sales line item to have the assocaited date to populate for each line item ) to the DSO. The code works and displays data being populated in new data tab

  • Problem Installing Itunes on Windows 7

    I have a brand new computer with Windows 7. I have downloaded Itunes, I select run, it completes the download and then nothing. There is no icon, no indication that it isi installed. It is not listd in the programs etc. I can't find it. What is wrong

  • Using a Component in many Web-Dynpros

    Hi gurus, following Problem: I'd like to develop a simple Component, that checks (using a standard RFC-User) if the current user is a valid SAP user. Therefor I have to create a JCO Connection and check the user via RFC in different Systems. The Comp

  • IOS 6 Wi-Fi fix that worked for me.

    I just downloaded IOS 6 and my Wi-fi was not working correctly, everytime I tried to connect to Wi-Fi it took my to an apple page and never loaded wi-fi up.  Here's what I did to fix it.  Click on settings>Wi-Fi>Click blue arrow next to network tryin

  • Paneldashboard with variable rowheight

    Hi. Is there a way to have a paneldashboard with different row heights ? I use it as a drop target and I want to drop there components of different heighs (ex: radio group needs more height that an input text). I wraped the droped coponents in panelg