Help on testing of servlet using TCPMon

I am trying to use TCPMon to test on my java servlet and when I press resend, the message below is generated. May I know how to solve it? Thanks you very much.
HTTP/1.1 400 Bad Request
Transfer-Encoding: chunked
Date: Mon, 21 May 2007 01:21:44 GMT
Server: Apache-Coyote/1.1
Connection: close
0
Below is what I send.
POST /servlet/TestServlet2 HTTP/1.1
Content-Length: 754
<?xml version="1.0" encoding="UTF-8"?>
<WV-CSP-Message xmlns="http://www.wireless-village.org/CSP1.1">
     <Session>
          <SessionDescriptor>
               <SessionType>Outband</SessionType>
          </SessionDescriptor>
          <Transaction>
               <TransactionDescriptor>
                    <TransactionMode>Request</TransactionMode>
                    <TransactionID>2</TransactionID>
               </TransactionDescriptor>
               <TransactionContent xmlns="http://www.wireless-village.org/TRC1.1">
                    <Login-Request>
                         <UserID>wv:tester</UserID>
                         <ClientID>
                              <URL>bp]b3QL~W7</URL>
                         </ClientID>
                         <Password>tester</Password>
                         <TimeToLive>600</TimeToLive>
                         <SessionCookie>MAGIC4_SESSION_COOKIE</SessionCookie>
                    </Login-Request>
               </TransactionContent>
          </Transaction>
     </Session>
</WV-CSP-Message>

i redid my program, and i was trying to figure out if this is the correct way to use the algorithm. also, are the two methods suppossed to be used this way.
import java.io.*;
import java.text.DecimalFormat;
public class lab1301
     public static void main(String args[]) throws IOException
                    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
          System.out.print("Enter the primes upper bound  ===>>  ");
          int MAX = Integer.parseInt(input.readLine());
          double sqrt=0;
          MAX++;
          boolean primes[] = new boolean[MAX];
          computePrimes(primes);
          displayPrimes(primes);
          System.out.println();
     public static void computePrimes(boolean [] primes)
          System.out.println();
          System.out.println("Computing prime numbers\t");
          System.out.println();
          final int MAX=primes.length;
          double sqrt = Math.sqrt(MAX);
          for(int i = 2; i < MAX; i++)
               primes[i] = true;
          for(int i = 2; i <= sqrt; i++)
               for(int j = i*2; j < MAX; j+=i)
                    primes[j] = false;
     public static void displayPrimes(boolean [] primes)
     DecimalFormat threeDigits= new DecimalFormat("000");
          for(int i = 0; i < primes.length; i++)
               if(primes)
                    System.out.print(threeDigits.format(i) + "\t");

Similar Messages

  • How to test servlet using Junit test????

    Hello everybody
    Does anybody know how to test an servlet class using Junit without using Cactus test . Is it possible to test a servlet using Junit without cactus test.Plz tell me the process how to test a servlet using Junit test .
    Regards
    srikant

    1) Do yoiu mean how to "run" your servlet code with sample parameter? This call manual testing with a sample run of you code. You need a web server(eg Tomcat), create a webapp with your servlet then deploy it there in order to run it.
    2) httpunit and junit are framework to write test case code that can be automated and repeatable. Plz read their doc.
    3) Your sample code me a very wrong way to retrieve and convert servlet parameters.
    Get a java toturial and servlet tutorial book and read it over the weekend. You need to get at least the basic.

  • Debugging servlets using jdb

    Hello friends, can anyone please help me in debugging servlets using jdb. I am using tomcat as the web server. Thanks

    http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/servlet.html

  • Testing servlet using Web2Go

    I am trying to test several servlets by registering the servelts to the Web Object Managers. After registering the servlets, I still cannot run the servlets. I can only run one at a time using "http://localhost:7070/servlets/servlet".
    Likewise, I named my servlets differently, eg. test01, test02, test03, etc. However, I cannot called it usnig the "http://localhost:7070/servlets/test01" as I thought it should after I register the servlets to the Web Object Manager.
    Is there anyway to look at the mapping of the Web2Go properties file? Where is it located? Is there a special setup to make the Web Object Manager to work properly?
    Any help will be greatful.

    The web object manger manipulates a file called wtgapp.xml. Webtogo looks for it jdev's lib directory (ie C:\jdev\lib). Unfortunately in jdev 3.1, the web object manager looks for it in the directory above (ie c:\jdev). You can get around the problem by copying it into the lib directory after you finish registration in the web object manager

  • Help!! I'm using a Mid 2012 MBP retina. for the past 2 years my write speeds has been consistently on 400MB/s via black magic test. but now it only have 100MB/s going down to 80MB/s. what should I do???? getting slower...

    Help!! I'm using a Mid 2012 MBP retina 2.3Ghz i7 with 8GB of ram 256SSD. for the past 2 years my write speeds has been consistently on 400MB/s and up via black magic test. but now it only have 100MB/s going down to 80MB/s. what should I do???? I have already cleaned and even restored my MBP still it's on 100MB/s. please help. I have to finish tasks on a timely manner.

    No. This requires completely repartitioning the SSD. You can do that only by using the Network Recovery method or the method I outlined. My method preserves all your data and doesn't require doing a slow Network Recovery. But if you wish to do that instead. The purpose of the whole exercise is to "clean" the SSD of garbage collected during use that tends to cause the SSD to slow down as you've described.
    Install OS X Using Internet Recovery
    Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.
    Boot to the Internet Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND-OPTION- R keys until a globe appears on the screen. Wait patiently - 15-20 minutes - until the Recovery main menu appears.
    Partition and Format the hard drive:
    Select Disk Utility from the main menu and click on the Continue button.
    After DU loads select your newly installed hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
    Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Security button. Set Zero Data - one-pass, click on the OK button. Click on the Partition button and wait until the process has completed. Quit DU and return to the main menu.
    Reinstall OS X: Select Reinstall OS X and click on the Install button. Be sure to select the correct drive to use if you have more than one.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
    This should restore the version of OS X originally pre-installed on the computer.

  • Strange Problem when Redirect to other Servlet using dispatch. Please help!

    I've a servlet which will check login session first, if not logged in, it will redirect to LOGIN servlet using "req.getRequestDispatcher(forwardTo).forward(req, resp);", it works fine. For eg, if I press ServletA it will redirect to LoginServlet. It works fine IF I DON'T RESTART TOMCAT.
    However, if I restart tomcat OR restart tomcat and close browser, then request ServletA again, it will display error:
    Apache Tomcat/4.0.1 - HTTP Status 404 - /sun.userlogin
    type Status report
    message /sun.userlogin
    description The requested resource (/sun.userlogin) is not available.
    BUT if I press RELOAD, it will become normal and REDIRECT me to LoginServlet. It's very strange and it troubles my development. The following is a part of my code, do you have any idea what's going wrong?Thanks.
    public class viewMyAcct extends HttpServlet
    public void doGet(HttpServletRequest req,
    HttpServletResponse resp)
    throws ServletException, java.io.IOException
    // Set the content type of the response
    resp.setContentType("text/html");
    // Create a PrintWriter to write the response
    java.io.PrintWriter out = resp.getWriter();
    HttpSession session = req.getSession(true);
    if (session == null) {
    out.println("ERROR: Internal servlet problem - no session");
    out.flush();
    out.close();
    return;
    UserLog ulog = (UserLog) session.getAttribute(USER);
    cmd = new sqlcmd();
    String uri = req.getRequestURI();
    if (ulog == null) {         
    String forwardTo = "sun.userlogin?where=RegForm"; //return to login page           
    //String forwardTo = "../"+uri.substring(0,uri.indexOf(".")) + ".userlogin?where=RegForm"; //return to login page      
         req.getRequestDispatcher(forwardTo).forward(req, resp);
         //http://127.0.0.1:8080/user/servlet/student.userlogin
         //here sure have login,get user loginid
         else{
    ...

    I got a reply why this problem occurs but do anyone of you know how to solve it? The reason is listed below:
    Hi Ken,
    The trouble starts when u restart tomcat,the servelet which is there in memory gets removed so the next time it has to cater to a request it has to go through init(), before getting into the service(), so when u restart and press for Re-login page,it has still not compiled, which it does on getting the first request and hence when u reload it, it responds

  • Communication with servlet using HTTPURLConnection

    Hi Again,
    well..trying to connect to a servlet using the HTTPURLConnection class.
    but the servlet is found (as i have put a system.out in init method of the servlet and that gets printed correctly).my problem is that the doget method does not get invoked.
    following is the code:
    client side:
    public class test
    public test()
    ObjectOutputStream outs=null;
    try
    URL url = new URL("http://127.0.0.1:7001/DataFetchServlet");
    HttpURLConnection urlcon = (HttpURLConnection)url.openConnection();
    System.out.println(urlcon.toString());
    urlcon.setRequestProperty("Content-Type","application/octet-stream");
    urlcon.setRequestMethod("GET");
    urlcon.setDoInput(true);
    urlcon.setDoOutput(true);
    urlcon.setUseCaches(true);
    outs = new ObjectOutputStream(urlcon.getOutputStream());
    String str = new String("hello");
    outs.writeObject(str);
    ObjectInputStream inp = new ObjectInputStream (urlcon.getInputStream());//********************
    outs.flush();
    outs.close();
    catch(Exception e)
         e.printStackTrace();
    //******************** THIS LINE GIVES A FILENOTFOUND EXCEPTION
    I am sure the servlet is found before the object is written but after the getInputStream it throws the excpetion..
    can anyone help?????
    THanx in advance

    urlcon.connect();

  • Unable to deploy a simple servlet using WAR file on Oracle9iAS v9.0.3

    Hi All,
    I am facing problem while deploying a simple servlet using WAR file on Oracle 9i App Server.
    I have installed Oracle9iAS J2EE and Web Cache v9.0.3 on Windows 2000 server.
    It includes:
         - Oracle HTTP Server
         - Oracle9iAS Containers for J2EE
         - Oracle9iAS Web Cache
         - Oracle Enterprise Manager
    The release of installed Oracle9iAS is Release 2 (9.0.3)      
    I referred following link to Deploy Applications Using WAR file:
         http://otn.oracle.com/products/ias/daily/sept12.html
    As mentioned in this documentation I have followed following steps to deploy WAR file:
    1] I have created a war file by name SimpleServlet.war. In SimpleServlet.war, there is a servlet by name Simple which prints time at which servlet was accessed.
    2] I have modified <ora9ias_home>\j2ee\home\config\application.xml and added following web module entry:
         <web-module id="SimpleServlet" path="../../home/applications/SimpleServlet.war" />
    3] To make this module accessible from over the web, I have modified file
         <ora9ias_home>\j2ee\home\config\default-web-site.xml and added following entry:
         <web-app application="SimpleServlet" name="SimpleServlet" root="/SimpleServlet"/>
    4] I saved both the files and started Oracle HTTP Server and accessed page as below:
              http://<server>:7777/SimpleServlet/Simple
    where Simple is servlet in SimpleServlet.war file.          
    In the browser, The page cannot be found is shown to user. I have verified that SimpleServlet.war is extracted to SimpleServlet folder under <ora9ias_home>\j2ee\home\applications folder. I found that Simple.class is stored under WEB-INF/classes folder and web.xml contains correct entry for url pattern for servlet Simple.
    What else could be the problem? Am I placing the war file in wrong place or modifying application.xml or default-web-site.xml in a wrong directory?
    This is very urgent. Please help me with your valuable comments on this.
    Thanks in advance.
    Regards,
    Sandesh

    Hi All,
    I am facing problem while deploying a simple servlet
    using WAR file on Oracle 9i App Server.
    I have installed Oracle9iAS J2EE and Web Cache v9.0.3
    on Windows 2000 server.
    It includes:
         - Oracle HTTP Server
         - Oracle9iAS Containers for J2EE
         - Oracle9iAS Web Cache
         - Oracle Enterprise Manager
    The release of installed Oracle9iAS is Release 2
    (9.0.3)      
    I referred following link to Deploy Applications
    Using WAR file:
         http://otn.oracle.com/products/ias/daily/sept12.html
    As mentioned in this documentation I have followed
    following steps to deploy WAR file:
    1] I have created a war file by name
    SimpleServlet.war. In SimpleServlet.war, there is a
    servlet by name Simple which prints time at which
    servlet was accessed.
    2] I have modified
    <ora9ias_home>\j2ee\home\config\application.xml and
    added following web module entry:
    <web-module id="SimpleServlet"
    path="../../home/applications/SimpleServlet.war" />
    3] To make this module accessible from over the web,
    I have modified file
    <ora9ias_home>\j2ee\home\config\default-web-site.xml
    and added following entry:
    <web-app application="SimpleServlet"
    name="SimpleServlet" root="/SimpleServlet"/>
    4] I saved both the files and started Oracle HTTP
    Server and accessed page as below:
              http://<server>:7777/SimpleServlet/Simple
    where Simple is servlet in SimpleServlet.war file.          
    In the browser, The page cannot be found is shown to
    user. I have verified that SimpleServlet.war is
    extracted to SimpleServlet folder under
    <ora9ias_home>\j2ee\home\applications folder. I found
    that Simple.class is stored under WEB-INF/classes
    folder and web.xml contains correct entry for url
    pattern for servlet Simple.
    What else could be the problem? Am I placing the war
    file in wrong place or modifying application.xml or
    default-web-site.xml in a wrong directory?
    This is very urgent. Please help me with your
    valuable comments on this.
    Thanks in advance.
    Regards,
    SandeshHave you restarted you http server and then tried to load it again? Are you using the right port; maybe you have to use port 7778? Check you server settings in the http server instance. Also check your url binding of you application at Farm > Application Server: infrastructurehost > OC4J_instance > Application: appname > Web Module: modulename
    Good luck!
    rgds Thomas

  • Unable to deploy a simple servlet using WAR file

    Hi All,
    I am facing problem while deploying a simple servlet using WAR file on Oracle 9i App Server.
    I have installed Oracle 9i App Server. I referred following link to Deploy Applications Using WAR file:
         http://otn.oracle.com/products/ias/daily/sept12.html
    As mentioned in this documentation I have followed following steps to deploy WAR file:
    1] I have created a war file by name SimpleServlet.war. In SimpleServlet.war, there is a servlet by name Simple which prints time at which servlet was accessed.
    2] I have modified <ora9ias_home>\j2ee\home\config\application.xml and added following web module entry:
         <web-module id="SimpleServlet" path="../../home/applications/SimpleServlet.war" />
    3] To make this module accessible from over the web, I have modified file
         <ora9ias_home>\j2ee\home\config\default-web-site.xml and added following entry:
         <web-app application="SimpleServlet" name="SimpleServlet" root="/SimpleServlet"/>
    4] I saved both the files and started Oracle HTTP Server and accessed page as below:
              http://<server>:7777/SimpleServlet/Simple
    where Simple is servlet in SimpleServlet.war file.          
    In the browser, The page cannot be found is shown to user. I have verified that SimpleServlet.war is extracted to SimpleServlet folder under <ora9ias_home>\j2ee\home\applications folder. I found that Simple.class is stored under WEB-INF/classes folder and web.xml contains correct entry for url pattern for servlet Simple.
    What else could be the problem? Am I placing the war file in wrong place or modfiying application.xml or default-web-site.xml in a wrong directory?
    This is very urgent. Please help me with your valuable comments on this.
    Thanks in advance.
    Regards,
    Sandesh

    Hi Juliana,
    Thanks a lot for your suggestion.
    I am sorry if I have posted this message to a wrong forum. This is first time I am posting a message to OTN. I will resend message to J2EE forum as per you suggestion.
    Meanwhile, please note information you asked for is as below:
    I installed Oracle9iAS J2EE and Web Cache v9.0.3 on Windows 2000 server.
    It includes:
         - Oracle HTTP Server
         - Oracle9iAS Containers for J2EE
         - Oracle9iAS Web Cache
         - Oracle Enterprise Manager
    The release of installed Oracle9iAS is Release 2 (9.0.3)      
    Please do reply at the earliest.
    Once again thanks and look forward to hear from you.
    Regards,
    Sandesh

  • Connecting a servlet using a midlet

    Hi,
    I am trying to connect to a servlet using a Midlet. The servlet is running fine on Apache Tomcat and I m able to build the MIDlet using J2MEWTK . But when I execute the Midlet on an emulator it shows me some code of html page of which the important line which might give u some hint is :
    the requested resource (/hitservlet) is not available.
    I wrote the code of HitServlet and Hitmidlet using a pdf on net....Do I need to install something else for executing this? I dont understand where is the problem. Should I post the codes? Is it something related to aliases...as indicated by some some tutorial...if so plss elaborate on it..
    If anybdy has any idea ...plss help me get out of this problem...
    Thanx
    Smeeta

    Have you added the URL of the Servlet into the J2ME application?
    Settings -> UserDefined Tab
    Thinks its
    HitMIDlet.URL and its value should be the URL of the Servlet

  • Obtaining client certificate in servlet using apache + tomcat

    Hi,
    I'm porting a webapplication from Javawebserver to Apache/1.3.6 (Win32) mod_jk mod_ssl/2.2.6 OpenSSL/0.9.2b
    The application needs to get the client certificate hash code.
    Using Javawebserver I used
    request.getAttribute ("javax.net.ssl.cipher_suite");
    request.getAttribute("javax.net.ssl.peer_certificates");
    etc
    How do I set up the apache webserver so that I can read the client certificate and what is the attribute called?
    I've tried this in the httpd.conf:
    SSLOptions +ExportCertData
    And the attribute:
    "SSL_CLIENT_CERT"
    Like it says in the Tomcat documentation.
    I'm not sure if I need to set up Tomcat as well..
    Any help would be greatly appriciated!
    Sincerely,
    AM Hjemaas

    Yup use ajp13 not ajp12 or mod_webapp
    refer to http://www.galatea.com/flashguides/apache-tomcat-24-win32.xml on setting up..
    THIS IS IMPORTANT!!!
    use Apache mod_jk.dll diretive:
    JkEnvVar Apache_Env_Var FORWARD_ALIAS
    this will send a apache environment variable (http://myapache/cgi-bin/printenv.pl to see whats available) to Tomcat
    JkEnvVar SSL_CLIENT_CERT SSL_CLIENT_CERT
    Then in Tomcat servlet use request.getAttribute("SSL_CLIENT_CERT") to get the cert in PEM format
    Hope this helps
    Jay

  • Cannot run a servlet using Tomcat. Urgent

    I have a webapplication which uses some jsp's and servlets. The jsp pages work fine when I use
    http://hostname:8080/MyWebapp/Filename.jsp
    However, when I developed a java servlet and put the class file in WEB-INF/classes directory of my web application and tried to access it.
    I got a resource not found error.
    The strange thing is that when I put the file in the web-inf/classes folder of examples webapplication (which comes with Tomcat) I am able to run the servlet using
    http://hostname:8080/examples/servlet/Class file
    I am not sure what is wrong.
    Can someone help me.
    Thanks in advance
    Vamsi.

    It's predictable. The Servlet and JSP specifications mandate that you cannot directly access resources under WEB-INF directory. You have to set up servlet mapping configuration in your web.xml to specify how to access the resources, both Servlet and JSP, there.
    When you copied your files in a demo webapp of Tomcat, the web.xml of the demo app already set up the mapping like following for you. So you could use http://hostname:8080/examples/servlet/Class to visit the servlet.
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    The default setting since Tomcat 4.1 turned off servlet invoker in web.xml under conf directory. You can uncomment the above lines in this file to turn it on. Then you are able to visit your servlet without <servlet-mapping> configured using the following syntax,
    http://hostname:8080/<your_app_name>/servlet/<your_servlet_name>

  • How to compile and run a Java servlet using the BEA weblogic server

              Hi,
              Could you help me out as to how to compile a servlet using Web Logic server.I have written a Servlet program and have also set up the environment in the "c:\bea\wlserver6.0\config\examples" folder by giving the command setExamplesEnv.cmd.
              I have stored my GreetingServlet.java file in "c:\bea\wlserver6.0\samples\examples\servlets" folder.
              How do I compile my servlet now?
              Vid
              

    Hello,
    1. The .form file was used by Netbean's GUI builder to create the .java and is not needed for compilation.
    2..../src # javac -classpath "..." mytool/*.java
    I guess the package mytool was not coped with.
    Alternatively it is worth to use the ant build tool also used by Netbeans.
    Then you can make a jar from the class files, indicate in the manifest.mf file:
    1. the main class
    2. the library jars

  • Kindly Help Me in This Servlet...

    the error is.. Can not issue data manipulation statements with executeQuery(). i cant.. update my database and also i cant delelete..
    what wrong in this servlet..
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Servlet1 extends HttpServlet
    Connection con = null;
    Statement stat = null;
    ResultSet result = null;
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void destroy()
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException
    response.setContentType("text/html");
    java.io.PrintWriter out = response.getWriter();
    try
         out.println("<html>");
    out.println("<head></head>");
    out.println("<body>");
    String table = "Employee";
    String field1 = "Firstname";
    String field1_label = "First Name";
    String field2 = "Lastname";
    String field2_label = "Last Name";
    String field3 = "Middlename";
    String field3_label = "Middle Name";
    String db_host = "localhost";
    String db_user = "root";
    String db_pass = "root";
    String db = "murach?";
    String query = "";
    String url = "jdbc:mysql://"+db_host+"/" + db;
    String driver = "org.gjt.mm.mysql.Driver";
    Class.forName(driver);
    con = DriverManager.getConnection(url, db_user, db_pass);
    stat = con.createStatement();
    String sort = request.getParameter("sort")+"";
    String read = request.getParameter("read")+"";
    String update = request.getParameter("update")+"";
    String delete = request.getParameter("delete")+"";
    String field1_value = request.getParameter("field1_value")+"";
    String field2_value = request.getParameter("field2_value")+"";
    String field3_value = request.getParameter("field3_value")+"";
    out.println("<html>");
    out.println("<head><title>Products Update</title></head>");
    out.println("<script language=\"JavaScript\">");
    out.println("function focusform() {");
    out.println("document.forms[1].field1_value.focus();");
    out.println("}");
    out.println("</script>");
    out.println("<head>");
    out.println("<center><body bgcolor=pink OnLoad=\"focusform()\">");
    if (!update.equals("null"))
         //query = "replace into" + table + "("+ field1 +",'"+ field2 +",'"+ field3 +"') values ("+ field1_value+",'"+ field2_value +",'"+field3_value+"')" ;
         query = "update" + table + " set " + field1 + "=\"" + field1_value + "\" , " + field2 + "=\"" + field2_value + "\"," + field3 + "=\"" + field3_value + "\"where Code="+ update;
         result = stat.executeQuery(query);
    if (!delete.equals("null"))
         query = "delete from " + table + " where Code=" + delete;
    if (!query.equals(""))
         result = stat.executeQuery(query);
    query = "select * from " + table;
    if (sort.equals("null")) sort=field1;
    if (sort.equals("Code")) query+=" order by Code";
    if (sort.equals(field1)) query+=" order by " + field1;
    if (sort.equals(field2)) query+=" order by " + field2;
    if (sort.equals(field3)) query+=" order by " + field3;
    if (!read.equals("null"))
    query = "select * from " + table + " where Code=" + read;
    result = stat.executeQuery(query);
    out.println("<table border=1 cellspacing=0>");
    out.println("<tr>");
    out.println("<td><a href=\"" + request.getRequestURL() + "?sort=Code\">Code</a></td>");
    out.println("<td><a href=\"" + request.getRequestURL() + "?sort=" + field1 + "\">" + field1_label + " </a></td>");
    out.println("<td><a href=\"" + request.getRequestURL() + "?sort=" + field2 + "\">" + field2_label + "</a></td>");
    out.println("<td><a href=\"" + request.getRequestURL() + "?sort=" + field3 + "\">" + field3_label + "</a></td>");
    out.println("<td colspan=2>");
    out.println("</td>");
    out.println("</tr>");
    if (read.equals("null"))
    while(result.next())
    out.println("<tr>");
    out.println("<td>");
    out.print(result.getString(1));
    out.println("</td>");
    out.println("<td>");
    out.print(result.getString(2));
    out.println("</td>");
    out.println("<td>");
    out.print(result.getString(3));
    out.println("</td>");
    out.println("<td>");
    out.print(result.getString(4));
    out.println("</td>");
    out.println("<td><a href=\"" + request.getRequestURL() + "?read=" + result.getString(1) + "\">Edit</a></td>");
    out.println("<td><a href=\"" + request.getRequestURL() + "?delete=" + result.getString(1) + "\">Delete</a></td>");
    out.println("</tr>");
    else
    while(result.next())
    out.println("<form action=\"" + request.getRequestURL() + "\" method=\"post\"> " + "\t <input type=hidden name=update value=" + result.getString(1) + ">");
    out.println("<tr>");
    out.println("<td>");
    out.print(result.getString(1));
    out.println("</a></td>");
    out.println("<td><input type=text size=10 name=field1_value value=" + result.getString(2) + "></td>");
    out.println("<td><input type=text size=10 name=field2_value value=" + result.getString(3) + "></td>");
    out.println("<td><input type=text size=15 name=field3_value value=" + result.getString(4) + "></td>");
    out.println("<td colspan=2 align=center><input type=submit value=\" Do it! \"></td>");
    out.println("</tr>");
    out.println("</form> ");      
    stat.close();
    con.close();
    out.println("</table>");
    catch(ClassNotFoundException e)
         out.println("Couldn't load database driver: " + e.getMessage());
    catch(SQLException e)
         out.println("SQLException caught: " + e.getMessage());      
    finally
         try
              if (con != null) con.close();
         catch (SQLException ignored)
    out.close();
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException
    processRequest(request, response);
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException
    processRequest(request, response);
    public String getServletInfo()
    return "4 Column ProductUpdate Java Servlet using MySQL.";
    hope you can help me about this..

    what is the entry in the tnsnames.ora for HRMIS? I am accessing thru client machine :
    In tnsnames.ora file
    HRMIS =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.93)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = hrmis)
    HRMIS_HRMIS =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = hrmis)(PORT = 1521))
    (CONNECT_DATA =
    (SID = hrmis)
    (SERVER = DEDICATED)
    In sqlnet.ora
    # sqlnet.ora Network Configuration File: D:\Oracle\product\10.1.0\Client_1\network\admin\sqlnet.ora
    # Generated by Oracle configuration tools.
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

  • Developing SIP Servlet using Eclipse

    Dear all,
    In the BEA documentation "developing SIP Servlet using Eclipse", it says:
    WebLogic SIP Server 3.0
    JDK 1.4.2
    Ant (installed with WebLogic SIP Server 3.0)
    Eclipse version 3.1
    CVS client and server (required only for version control)
    I want to kown it should be JDK 1.4.2 but not 1.5.0?
    And how to set Ant which installed with Weblogic SIP Server in Eclipse? Because I checked that Eclipse use the Ant by defaut.
    I really have problem with setting up Eclipse for developping SIP Servlet, Thanks for your help!
    li

    Dear all,
    I have resolved it.
    The path is not correct in the ant build file.
    Thanks

Maybe you are looking for

  • Modifying Drum Loops to fit 12/8 time

    My current project is in 12/8 time. When I try to insert drum loops there are virtually no drum loops to add (most options are greyed out). So I have changed the time to 4/4 so that I can access and modify a drum loop. Note - even though the time on

  • Bj or view to flatten "cell" records into "row" record

    I have ProdPrice records which are essentially "cells" in a price matrix. create table ProdPrice { ProdNum number (12,0), Quality char(1), Condition char(1), Price number(15,3), ... (other stuff) with primary key (ProdNum, Quality, Condition) where Q

  • UNDO Tables Space File deleted accidently

    Dear All, I performed following actions on my Oracle 11g Database under Windows 32-bits OS. CREATE UNDO TABLESPACE UNDOTBS2 DATAFILE 'C:\app\oradata\ABCD\undotbs2.dbf' SIZE 10 M AUTOEXTEND OFF ; ALTER SYSTEM SET undo_tablespace = UNDOTBS2; shutdown i

  • DEFINATIONS

    hi, any one can give me definations of SALES OREDR,QUATATION,PURCHASE ORDER,INVOICE,DELIVERY,COMPANY CODE,SALES ORGANIZATION,PLANT,WARE HOUSE.

  • When is Bluetooth going to be fixed?

    I have a pair of Sony Bluetooth headphones. If I want to use them with Snow Leopard, I have to reboot my Mac between sessions. The headphones will apparently stay paired but not connected between sessions. For example, after rebooting I can see sever