Results 1 to 5 of 5
  1. #1
    lse123 is offline Senior Member
    Join Date
    Oct 2008
    Posts
    116
    Rep Power
    0

    Default how from an Access Currency field I populate a hidden field

    Java Code:
    //out.println("<input type=\"hidden\" name=\"price" + plantNo + "\" value=\"" + rs.getString(5) + "\">");
    The above found to give errors... how from Access Currency field like price=
    rs.getString(5)
    I populate a hidden field ? How do it in MySQL ?

    Servlets upon compilation(or update) needed server restart to rerun (updated) ?

  2. #2
    lse123 is offline Senior Member
    Join Date
    Oct 2008
    Posts
    116
    Rep Power
    0

    Default make it more clear rs.getString(5)-nowork/"8.9"-work

    if I insert
    rs.getString(5) // field5 = currency field MS-Access DB
    it doesn't work, but if insert
    "8.9"
    work in value of hidden field , where error ?
    out.println("<input type=\"hidden\" name=\"price" + plantNo + "\" value=\"" + rs.getString(5) + "\">"); // "8.9"

  3. #3
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Don't try to output HMTL from servlets like that.
    Use a JSP for the presentation. After collecting the results from a helper class whose methods are called from the servlet, set the results as request attributes in the servlets and let the servlet route to a JSP. You would then retrieve these attributes in the JSP and present the values.

  4. #4
    lse123 is offline Senior Member
    Join Date
    Oct 2008
    Posts
    116
    Rep Power
    0

    Default

    may problem above be in the DATA, I have:
    total+=Double.parseDouble(request.getParameter("pr ice"+i))*Integer.parseInt(request.getParameter("pl antQuantity"+i));
    somewhere in the doPost executed after submit form with hidden:
    out.println("<input type=\"hidden\" name=\"price" + plantNo + "\" value=\"" + rs.getString(5) + "\">"); // "8.9"

    As you say SOLUTION: how transfer from servlet to JSP request attributes/data ? Also how in servlet forward or transfer control to JSP...?

  5. #5
    lse123 is offline Senior Member
    Join Date
    Oct 2008
    Posts
    116
    Rep Power
    0

    Default I include servlet, get data from:this is textbook problem (self solve not instructed)

    Please answer asap.... this is textbook problem (self solve not instructed)...

    I include[attach] whole servlet, get data from:

    <body>
    <form action="/Webdbt/flowerpower" method="get">
    <p>
    <h3>Choose your favorite color and click Submit Answer!!</h3>
    <select name="choiceColor">
    <option value="Peach">Peach</option>
    <option value="Pink">Pink</option>
    ...............................................

    MS-ACCESS DATABASE and field:5, is of currency type. UNDER TOMCAT.
    Attached Files Attached Files

Similar Threads

  1. Entity - Field-Based Access Vs Property Based Access
    By CatchSandeepVaid in forum Enterprise JavaBeans (EJB)
    Replies: 3
    Last Post: 11-02-2009, 08:18 PM
  2. Field type
    By code_worm in forum New To Java
    Replies: 15
    Last Post: 10-21-2009, 04:03 PM
  3. Method access or field access
    By carderne in forum New To Java
    Replies: 2
    Last Post: 12-06-2008, 07:20 PM
  4. Search field in the browser
    By sandeeprao.techno in forum Advanced Java
    Replies: 4
    Last Post: 06-07-2008, 08:37 AM
  5. Regarding Text Field
    By adeeb in forum AWT / Swing
    Replies: 1
    Last Post: 06-06-2008, 12:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •