Read values from html response

Hi,
I am trying to make a call to an API using UTL_HTTP POST method over SSL and read the response html page and extract the values from the reponse.
I am able to call and get a response back in html format. I have stored the html response in a clob variable.
Now i want to parse this html and extract values from the form input items and send them out through OUT parameters.
For example, from below reponse i want to extract the value '1111d7nhcwse30wq' from 'I4GO_UNIQUEID'
Can anyone help me with the code to parse this html response and extract the values.
Any help is greatly appreciated.
Thanks
Sharath
sample Code:
PROCEDURE get_token (
p_requesterreference IN VARCHAR2,
p_cardnumber IN VARCHAR2,
p_cardtype IN VARCHAR2,
p_cardholdername IN VARCHAR2,
p_expirationmonth IN VARCHAR2,
p_expirationyear IN VARCHAR2,
p_streetaddress IN VARCHAR2,
p_postalcode IN VARCHAR2,
p_cvv2code IN VARCHAR2,
po_uniqueid OUT VARCHAR2,
po_errorindicator OUT VARCHAR2,
po_primaryerrorcode OUT VARCHAR2,
po_response OUT VARCHAR2,
po_status_code OUT VARCHAR2,
po_reason_phrase OUT VARCHAR2
IS
v_url VARCHAR2 (200);
v_url_params VARCHAR2 (32767);
v_resp_str VARCHAR2 (32767);
l_http_req UTL_HTTP.req;
l_http_resp UTL_HTTP.resp;
v_requesterreference VARCHAR2 (12) := p_requesterreference;
v_i4go_cardnumber VARCHAR2 (32) := p_cardnumber;
v_i4go_streetaddress VARCHAR2 (30) := p_streetaddress;
v_i4go_postalcode VARCHAR2 (9) := p_postalcode;
v_i4go_expirationmonth VARCHAR2 (2) := p_expirationmonth; -- MM format
v_i4go_expirationyear VARCHAR2 (2) := p_expirationyear; -- yy format
v_i4go_cvv2code VARCHAR2 (3) := p_cvv2code;
v_name VARCHAR2 (256);
v_value VARCHAR2 (1024);
l_clob CLOB;
pv_amp CONSTANT CHAR (1) := CHR (38);
CURSOR setup_cur
IS
SELECT interface_id, interface_name, interface_url, account_id, site_id
FROM rsv.shift4_setup
WHERE interface_name = 'I4GO';
v_setup_rec setup_cur%ROWTYPE;
BEGIN
OPEN setup_cur;
FETCH setup_cur
INTO v_setup_rec;
CLOSE setup_cur;
v_url := 'https://certify.i4go.com//index.cfm?fuseaction=account.PostCardEntry';
v_url_params :=
pv_amp
|| 'i4GO_AccountID='
|| v_setup_rec.account_id
|| pv_amp
|| 'i4Go_SiteID='
|| v_setup_rec.site_id
|| pv_amp
|| 'i4Go_CardNumber='
|| v_i4go_cardnumber
|| pv_amp
|| 'i4Go_ExpirationMonth='
|| v_i4go_expirationmonth
|| pv_amp
|| 'i4Go_ExpirationYear='
|| v_i4go_expirationyear
|| pv_amp
|| 'i4Go_CVV2Code='
|| v_i4go_cvv2code
|| pv_amp
|| 'i4Go_PostalCode='
|| v_i4go_postalcode;
-- begin request using POST method
UTL_HTTP.set_response_error_check (FALSE);
UTL_HTTP.set_transfer_timeout (180);
UTL_HTTP.set_wallet ('file:/etc/ORACLE/WALLETS/oracle', 'welcome1');
l_http_req := UTL_HTTP.begin_request (v_url, 'POST');
UTL_HTTP.set_header (l_http_req, 'User-Agent', 'Mozilla/4.0');
UTL_HTTP.set_header (l_http_req, 'Content-Type', 'application/x-www-form-urlencoded');
UTL_HTTP.set_header (l_http_req, 'content-length', LENGTH (v_url_params));
UTL_HTTP.write_text (l_http_req, v_url_params);
-- get response
l_http_resp := UTL_HTTP.get_response (l_http_req);
po_status_code := l_http_resp.status_code;
po_reason_phrase := l_http_resp.reason_phrase;
-- read response into a clob
DBMS_LOB.createtemporary (l_clob, FALSE);
BEGIN
LOOP
UTL_HTTP.read_text (l_http_resp, v_resp_str, 32767);
DBMS_LOB.writeappend (l_clob, LENGTH (v_resp_str), v_resp_str);
END LOOP;
EXCEPTION
WHEN UTL_HTTP.end_of_body
THEN
-- end response
UTL_HTTP.end_response (l_http_resp);
END;
-- Fre resources
DBMS_LOB.freetemporary (l_clob);
EXCEPTION
WHEN OTHERS
THEN
DBMS_LOB.freetemporary (l_clob);
DBMS_OUTPUT.put_line (UTL_HTTP.get_detailed_sqlerrm);
RAISE;
END;
sample response:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
     <title>Return With Payment Token</title>
     <script src="js/jquery-1.6.4.min.js" type="text/javascript"></script>
     <script type="text/javascript"><!--
          picSpinner= new Image(40,40);
          picSpinner.src="images/loading040.gif";
          bodyOnLoad = function() {
               $("#noScriptDiv").hide();
               $("#scriptDiv").show();
               $("#i4GoMainForm").submit();
     //--></script>
</head>
<body onload="bodyOnLoad();">
     <form name="i4GoMainForm" id="i4GoMainForm" action="http://google.com" method="POST" onsubmit="$('#i4Go_submit').attr('disabled','disabled');">
               <input name="I4GO_RESPONSE" type="hidden" value="SUCCESS" />
               <input name="I4GO_RESPONSECODE" type="hidden" value="1" />
               <input name="I4GO_CARDTYPE" type="hidden" value="VS" />
               <input name="I4GO_UNIQUEID" type="hidden" value="1111d7nhcwse30wq" />
               <input name="I4GO_EXPIRATIONMONTH" type="hidden" value="12" />
               <input name="I4GO_EXPIRATIONYEAR" type="hidden" value="2012" />
               <input name="I4GO_CARDHOLDERNAME" type="hidden" value="" />
               <input name="I4GO_STREETADDRESS" type="hidden" value="" />
               <input name="I4GO_POSTALCODE" type="hidden" value="65000" />
          <div id="scriptDiv" style="font-family:Arial, Helvetica, sans-serif;font-size:18px;visibility:hidden;">
               <img src="images/loading040.gif" alt="Spinner..." />  Loading...
          </div>
          <div id="noScriptDiv" style="font-family:Arial, Helvetica, sans-serif;">
               <noscript>
                                   <h1>Statement of Tokenization</h1>
                                   <p>The payment information you have submitted has been securely stored in the Shift4 PCI-DSS certified data center and a token representing this information will be sent to the merchant for processing. Below is the information that will be returning to the originating merchant:</p>
                                   <ul>
                                        <li>Response: <strong>SUCCESS</strong></li>
                                        <li>Response Code: <strong>1</strong></li>
                                        <li>Card Type: <strong>VS</strong></li>
                                        <li>Token: <strong>1111d7nhcwse30wq</strong></li>
                                   </ul>
               </noscript>
<input type="submit" name="i4Go_submit" id="i4Go_submit" value="Continue" />
          </div>
     </form>
</body>
</html>
Edited by: sgudipat on Apr 24, 2012 1:20 PM

Here is working example for your HTML using xpath to extract values from html
You can store your html response in clob variable and then extract the value with xpath
declare
   l_clob clob;
   l_value varchar2(100);
   l_xml xmltype;
  begin
     l_clob :='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <title>Return With Payment Token</title>
  <script src="js/jquery-1.6.4.min.js" type="text/javascript"></script>
  <script type="text/javascript"><!--
   picSpinner= new Image(40,40);
   picSpinner.src="images/loading040.gif";
   bodyOnLoad = function() {
   $("#noScriptDiv").hide();
   $("#scriptDiv").show();
   $("#i4GoMainForm").submit();
  //--></script>
   </head>
   <body onload="bodyOnLoad();">
   <form name="i4GoMainForm" id="i4GoMainForm" action="http://google.com" method="POST" onsubmit="$(''#i4Go_submit'').attr(''disabled'',''disabled'');">
   <input name="I4GO_RESPONSE" type="hidden" value="SUCCESS" />
   <input name="I4GO_RESPONSECODE" type="hidden" value="1" />
   <input name="I4GO_CARDTYPE" type="hidden" value="VS" />
   <input name="I4GO_UNIQUEID" type="hidden" value="1111d7nhcwse30wq" />
   <input name="I4GO_EXPIRATIONMONTH" type="hidden" value="12" />
   <input name="I4GO_EXPIRATIONYEAR" type="hidden" value="2012" />
   <input name="I4GO_CARDHOLDERNAME" type="hidden" value="" />
   <input name="I4GO_STREETADDRESS" type="hidden" value="" />
   <input name="I4GO_POSTALCODE" type="hidden" value="65000" />
  <img src="images/loading040.gif" alt="Spinner..." />  Loading...
   <noscript>
   Statement of Tokenization
   The payment information you have submitted has been securely stored in the Shift4 PCI-DSS certified data center and a token representing this information will be sent to the merchant for processing. Below is the information that will be returning to the originating merchant:
       Response: SUCCESS
       Response Code: 1
       Card Type: VS
       Token: 1111d7nhcwse30wq
   </noscript>
   <input type="submit" name="i4Go_submit" id="i4Go_submit" value="Continue" />
   </form>
   </body>
   </html>';
     execute immediate 'alter session set events =''31156 trace name context forever, level 2''';
     l_xml := xmltype(l_clob);
     execute immediate 'alter session set events =''31156 trace name context off''';
     select extractvalue( l_xml
                        , '/html/body/form/input[@name="I4GO_CARDTYPE"]/@value'
                        , 'xmlns="http://www.w3.org/1999/xhtml"' )
     into l_value
     from dual;
     dbms_output.put_line(l_value);
   end;
Problem when parsing html with xpath and xmltype
Edited by: peterv6i.blogspot.com on Apr 26, 2012 9:38 AM

Similar Messages

  • How to get the values from html:select? tag..?

    i tried with this, but its not working...
    <html:select styleClass="text" name="querydefs" property="shortcut"
                 onchange="retrieveOptions()" styleId="firstBox" indexed="true">
    <html:options collection="advanced.choices" property="shortcut" labelProperty="label" />
    </html:select>
                        <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>

    <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>This java script is not working at all..its not printing anything in document.write();
    This is code..
    <td class="rowcolor1" width="20%">
    <html:select styleClass="text" name="querydefs" property="shortcut"
                             onchange="retrieveSecondOptions()" styleId="firstBox"
                             indexed="true">
                             <html:options collection="advanced.choices" property="shortcut"
                                  labelProperty="label"  />
                        </html:select>i tried with this also. but no use..i'm not the getting the seleced option...
    function retrieveOptions(){
    firstBox = document.getElementById('firstBox');
                             if(firstBox.selectedIndex==0){
          return;
        selectedOption = firstBox.options[firstBox.selectedIndex].value;
    }actually , how to get the values from <html:select> ...?
    my idea is to know which value is selected from the combo box(<html:select> ) if that value is equal some string i have enable a hyperlink to open a popup window

  • Reading values from lookup columns through custom workflow in SharePoint 2013

    We are able to read the values of text, number columns through custom workflow (via coding) in SharePoint 2013. However, we are not able to read values from lookup columns. So, request anyone to provide help on this.
    Thanks & regards,
    Aditya

    Hi,
    According to your post, my understanding is that you want to read values from lookup columns through custom workflow in SharePoint 2013.
    Since the workflow just doesn't get lookup fields, let's give it something static to work with instead. If we can capture the ID of the lookup field and store that as a static value in our list, the workflow can happily use that to look up our related.
    For more information, you can refer to:
    SharePoint 2013 Workflows and Lookup Columns
    Thanks,
    Linda Li                
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • I am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    i am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    hi TimoHahn,
    i am getting following exception in JDeveloper(11g release 2) Studio Edition Version 11.1.2.4.0 but it works perfectly fine in JDeveloper 10.1.2.1.0
    Root cause of ServletException.
    java.lang.NullPointerException
    at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:136)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
    at java.util.ResourceBundle.getString(ResourceBundle.java:334)
    at org.rbi.cefa.master.actionclass.UserAction.execute(UserAction.java:163)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

  • How to read values from the following XML?

    I have been using "extractValue" to get the values from a xmltype field and no problems until now.
    The xmltype now is like:
    <a>1</a>
    <b>2</b>
    <c>1221</c>
    <c>1412</c>
    <d>11111</d>
    <e>3333</e>
    I'm able to read values from 'a,b,d,e' but not from 'c'.
    Questions:
    1)- Is posible to read the values of field c?. How?
    2)- If is not posible to read the field values, Is posible to transfor the xmlfield to:
    Where I will be able to use xmltable columns and loop getting the values.
    <a>1</a>
    <b>2</b>
    <k>
    <c>1221</c>
    <c>1412</c>
    </k>
    <d>11111</d>
    <e>3333</e>
    Like always
    Thank you in advance for your help.
    Jose Galan

    SQL> with XML as
      2  (
      3   select xmltype(
      4  '<root>
      5    <a>1</a>
      6    <b>2</b>
      7    <c>1221</c>
      8    <c>1412</c>
      9    <d>11111</d>
    10    <e>3333</e>
    11  </root>'
    12  ) XMLDOC
    13    from dual
    14  )
    15  select a, b,c, d, e
    16    from XML,
    17         XMLTABLE
    18         (
    19            '/root'
    20            passing XMLDOC
    21            columns
    22            A number(5) path 'a',
    23            B number(5) path 'b',
    24            D number(5) path 'd',
    25            E number(5) path 'e',
    26            C_XML_FRAG xmltype path 'c'
    27         ),
    28         XMLTABLE
    29         (
    30           '/c'
    31           passing C_XML_FRAG
    32           columns
    33           C number(5) path '.'
    34         )
    35  /
             A          B          C          D          E
             1          2       1221      11111       3333
             1          2       1412      11111       3333
    SQL>

  • APP-FND-01242: Cannot read value from field Error in Forms

    Hi,
    I have a form which is having a navigation
    Setup -> Codes,
    as soon as the Code page has open, am pressing Cntrl + F11, and am getting the
    below error.
    APP-FND-01242: Cannot read value from field COMBO.ENABLED_FLAG
    Cause: The field COMBO.ENABLED_FLAG could not be located or read.
    Action: This error is normally the result of an incorrectly-entered field name string in a trigger, or a field name string that does not uniquely specify a field in your form. Correct your trigger logic to precisely specify a valid field.
    when am clicking on the button 'Ok' am getting a value one by one.
    am a newbie to forms, please let me know how to solve this error in details
    steps that helps me

    Ask your question in an eBusiness-suite related forum, maybe here OA Framework

  • How to read values from DMM4040

    Hi,
       I am using DMM4040, NI PXI 6509 device.
    I need to make some port pins high which i have already done and now i have to read value captured by DMM then i have to make my port pins low if my value is within limits.
    Can u suggest me how to read values from DMM and then by notification i ll make my port pins low.
    '' A professional is someone who can do his best work when he doesn't feel like it''...........

    What language are you using?  If using LabVIEW, you use the NI-DMM API to communicate with the 4040.  Just take your reading, do your limit comparison, and set your lines based on the comparison results.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Passing values from HTML to JSP method,

    Hello:
    I am starting to wonder if what I am doing will ever work...
    Ok, I am trying to avoid javascript. I have a drop-down list named "year" and I wish to call a JSP method that is defined/declared in the same JSP.
    First, I want to pass the chosen option to the method and then store the name/value in a global variable.
    Second, depending on what the user selects, I will get values from an array defined/initialized on page load AND display those values in another drop-down list.
    As a test, and until now, I have done this. I am not passing anything yet, I just wanted to test this "fuzzy logic" I am having:
    <%!
    String currentYear;
    private void showDaysInDDList()
    currentYear = request.getparameter("year");
    %>
    Then on the HTML part of the page I have a drop-down list:
    <html>
    <head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="style.css">
    </head>
    <body bgcolor="ffffcc">
    <form method="POST" name="form1" action="left.jsp">
    <select name="year" onchange="<%=showDaysInDDList()%>">
         <option></option>
         </select>
    I am getting the following errors:
    An error occurred at line: 105 in the jsp file: /p1/left.jsp
    request cannot be resolved
    ....and regarding to the onchange="<%=showDaysInDDList()%>"> part I am getting the following:
    An error occurred at line: 204 in the jsp file: /p1/left.jsp
    The method print(boolean) in the type JspWriter is not applicable for the arguments (void)
    In the action="left.jsp", left.jsp is the same page where the drop-down list and the method is. I am not sure if that is another error.
    I will continue here with my coffee ... any help will be extremely appreciated !!..
    I'll have to shut down my "asp.net mind" for a while..
    I'll reply later,
    MMS

    Ok, this is a bit messy here. I don't know how much you've read up on JSP but you seem confused about some fundamentals to me. However, you mention that you've worked with ASP .net so I'm going to assume you do have some notion of how thing should work in general.
    1. JSP is on the server-side and events like onchange that you've used take place on the client-side after the JSP/ servlet code has run and produced the HTML page. So calling your showDaysInDDList() will not work.
    2. Are you sure you know how the declaration tags ( <%! %> ) work? When you normally write JSP code without these tags, all that code gets compiled into the service method of the corresponding servlet that the JSP gets turned into. But, you can declare your own methods and variables outside the service method by using these tags.
    So what you're effectively doing is declaring
    private String/ void showDaysInDDList()
    }and followed by your usual _jspService()
    public void _jspService(HttpServletRequest request,
       HttpServletResponse  response)
         throws IOException, ServletException
    }Now it may be clear, that the request object is not available in the showDaysInDDList() method by default; you'll either have to declare it ( not sure if it's good programming practice or not ) or pass the required parameters in the call.
    3. Like you seem to have realized, that error about the printing of booleans was related to the return type of your method because <%= %> translates to out.println(); and since the argument was the method call, the return value was to be printed which here was a void ( not sure why it says boolean though :D ).
    Read up on this introduction to JSPs http://java.sun.com/developer/onlineTraining/JSPIntro/contents.html, seems to be pretty good and covers everything in quick, short chunks.
    Hope this helps.

  • How to read value from Key flexfield added on to the newly created SIT

    Hi Experts,
    I have a requirrment to display a new structure in the Special Information Types (SIT) screen in SSHR. The data entered into the segment needs to be validated using PL/SQL function.
    I have performed below steps to display the structure/field on SIT Page
    1. Created new flexfield structure as XX_LEAVE_ENCASHMENT under the "HUMAN RESOURCE" Application (Application id- 800) and flexfield TITLE "Personal Analysis Flexfield" (PEA).
    2. Added a new segment "Encash Days" for the newly created flexfiled structure "XX_LEAVE_ENCASHMENT".
    3. Added this new structure in the Special Information Types form in HRMS responsibility
    4. The structure is enabled on the SIT screen.
    Now I want to validate the data entered in Encash Days field in this page by calling a PL/SQL function. This can be done by extending the SIT page Controller.
    But how should the ID of the newly enabled segment (in the new Flexfield strucuture) be retrieved in the controller inorder to read the user-entered value (to further call the validation program)? Or is there any other way of achieving this functionality in OAF?
    Please help.
    Thanks.

    Hi,
    Yes, u can get the value from the SIT and perform the relevant validation too.
    Refer http://apps2fusion.com/at/43-ss/453-oaf-extension-case-study
    Regards,
    Gyan

  • Reading value from bar code reader into JSP

    Hi all,
    I am designing a web-site which can read the barcode value from the barcode scanner.Please let me know how to do that.
    Awaiting Reply.
    Thanks
    Gowrishankar

    1) I don't think there's a <input type="barcode-reader"/> form element in HTML - whether it was generated from a JSP or not doesn't matter.
    2) You could use an applet. But only if the user has all necessary means installed to let Java use the barcode reader.
    3) The applet needs to be signed, of course.
    4) If the user doesn't have the stuff installed, you could theoretically make the applet install it, if it knows where to get the resources and if the access restrictions allow it.
    So there's a purely theoretical possibility at best.

  • Reading Values from Listbox and data source into MS Office Toolkit

    Hi,
    Been trying to get this to work but making no progress and my lack of experience on labview is becoming a hinderence.
    Does anyone know how I can read the values from the listbox example attached into MS Office Toolkit for Excel?
    The values from the listbox need to be compared to mulitple values from a strain data source.
    Cheers,
    Mike.
    Attachments:
    Capture.PNG ‏62 KB

    Hi,
    Ok in the attached vi I want value from the listbox "0kg through to 10kg" to be put into the excel table in the report generation toolkit along side data from the convert strain gauge reading.
    Cheers,
    Mick.
    Attachments:
    Strain Gauge Edit2.vi ‏112 KB

  • Reading values from ServletRequst in Filter

    I have a filter that captures some basic info (request method and uri) from request. But whenever I read parameters contained in http request for "POST" method, I can't figure out how to repost parameters to request. I think that after I read parameters from request in filter, parameters aren't available in http servlet. I think that I have to repost parameters to request after i read it.
    does anybody know how to do it?

    here is the code.
         BufferedReader in = new BufferedReader( new InputStreamReader (request.getInputStream()));
         String line = null;
         while (null != (line = in.readLine()))
              System.out.println(line);
    After I use request.getInputStream(), I can't retrieve values from parameters. is there any way to handle this issue?
    I'd appreciated for any idea.

  • Reading values from standard report in custom report dynamically

    Hello Gurus,
    I have a strange requirement, We have some standard reports which displays output in drop down blocked data. I want to create a custom report which will get that data in my internal tables.
    Just to elaborate this requirement, I will give you a example:
    I have a standard report which output as first line 'A' and second line as 'B'. Now when I press drop down in 'A', it displays line items say 1,2,3,4,5.... Similarly block 'B' once when pressed displays line items 6,7,8,9,10.
    Here I want a custom report which directly read data from this standard report and gives us the values of line items 1,2,3,4,5 in one internal table and similarly items 6,7,8,9,10 in another internal table.
    Hope the question clarifies the requirement now.
    Request you to please provide the resolution.
    Thanks,
    Harjeet

    Hi Harjeet,
    Use sumit statement for standard program and export the list to  memory. and then read list from memory and use in your custom program.
    Use below code for reference.
    DATA: t_list TYPE abaplist OCCURS 0.
    SUBMIT rfdopr10
                    ************** your options
                    AND RETURN
                    EXPORTING LIST TO MEMORY.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject       = t_list
      EXCEPTIONS
        NOT_FOUND        = 1
        OTHERS           = 2.
    BR,
    Vijay

  • Reading values from JTextField and using them?

    Hello,
    I am trying to make a login screen to connect to an oracle database. Im pretty new to creaing GUI. I need help with reading the values from the JTextField and to be able to use them for my connection. So do I need to apply a listener? How do I go about doing that in this project. Thanks for any code or advice.
    import java.util.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    import java.sql.*;
    public class UserDialog
        String databaseURL;
        String driver;
        String database;
        String username;
        String password;
        String hostname;
        String port;
        UserDialog() {
            getInfo();
        static String[] ConnectOptionNames = { "Login", "Cancel" };
        static String   ConnectTitle = "Login screen";
        public void getInfo() {
            JPanel      connectionPanel;
            JLabel     databaseURLLabel = new JLabel("Database URL:   ", JLabel.LEFT);
         JTextField databaseURLField = new JTextField("");
         JLabel     driverLabel = new JLabel("Driver:   ", JLabel.LEFT);
         JTextField driverField = new JTextField("");
            JLabel     databaseLabel = new JLabel("Database:   ", JLabel.LEFT);
         JTextField databaseField = new JTextField("");
            JLabel     usernameLabel = new JLabel("User Name:   ", JLabel.LEFT);
         JTextField usernameField = new JTextField("");
            JLabel     passwordLabel = new JLabel("Password:   ", JLabel.LEFT);
         JTextField passwordField = new JPasswordField("");
            JLabel     hostnameLabel = new JLabel("Host Name:   ", JLabel.LEFT);
         JTextField hostnameField = new JTextField("");
            JLabel     portLabel = new JLabel("Port:   ", JLabel.LEFT);
         JTextField portField = new JTextField("");
         connectionPanel = new JPanel(false);
         connectionPanel.setLayout(new BoxLayout(connectionPanel,
                                  BoxLayout.X_AXIS));
         JPanel namePanel = new JPanel(false);
         namePanel.setLayout(new GridLayout(0, 1));
         namePanel.add(databaseURLLabel);
         namePanel.add(driverLabel);
            namePanel.add(databaseLabel);
            namePanel.add(usernameLabel);
            namePanel.add(passwordLabel);
            namePanel.add(hostnameLabel);
            namePanel.add(portLabel);
         JPanel fieldPanel = new JPanel(false);
         fieldPanel.setLayout(new GridLayout(0, 1));
         fieldPanel.add(databaseURLField);
            fieldPanel.add(driverField);
            fieldPanel.add(databaseField);
            fieldPanel.add(usernameField);
         fieldPanel.add(passwordField);
            fieldPanel.add(hostnameField);
            fieldPanel.add(portField);
         connectionPanel.add(namePanel);
         connectionPanel.add(fieldPanel);
            // Connect or quit
            databaseURL = databaseURLField.getText();
            driver = driverField.getText();
            database = databaseField.getText();
            username = usernameField.getText();
            password = passwordField.getText();
            hostname = hostnameField.getText();
            port = portField.getText();
            int n = JOptionPane.showOptionDialog(null, connectionPanel,
                                            ConnectTitle,
                                            JOptionPane.OK_CANCEL_OPTION,
                                            JOptionPane.PLAIN_MESSAGE,
                                            null, ConnectOptionNames,
                                            ConnectOptionNames[0]);
            if (n == 0) {
                System.out.println("Attempting login: " + username);
                String url = databaseURL+hostname+":"+port+":"+database;
             // load the JDBC driver for Oracle
             try{
                   DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                   Connection con =  DriverManager.getConnection (url, username, password);
                System.out.println("Congratulations! You are connected successfully.");
                con.close();
                System.out.println("Connection is closed successfully.");
             catch(SQLException e){
                System.out.println("Error: "+e);
            else if (n == 1)
                    System.exit(0);
        public static void main (String args []) {
             UserDialog ud = new UserDialog();
    }thanks again,
    James

    the reason why you can't get the text is because you are reading the value before some actually inserts anything in any fields.
    Here is what you need to do:
    Create a JDialog/JFrame. Create a JPanel and set that panel as contentPane (dialog.setContentPane(panel)). Insert all the components, ie JLabels and JTextFields. Add two buttons, Login and Cancel to the panel as well. Now get the username and password field values using getText() inside the ActionListener of the Login.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class LoginDialog extends JDialog
    String username, password;
      public LoginDialog( ){
        setTitle( "Login" );
        JPanel content = new JPanel(new GridLayout(0, 2) ); // as many rows, but only 2 columns.
        content.add( new JLabel( "User Name" ) );
        final JTextField nameField = new JTextField( "" );
        content.add( nameField );
        content.add( new JLabel( "Password" ) );
        final JTextField passField = new JTextField( "" );
        content.add( passField );
        JButton login = new JButton( "Login" );
        login.addActionListener( new ActionListener(){
          public void actionPerformed( ActionEvent ae ){
            username = nameField.getText();
            password = passField.getText();
            // call a method or write the code to verify the username and login here...
        content.add( login );
        JButton cancel = new JButton( "Cancel" );
        cancel.addActionListener( new ActionListener( ){
          public void actionPerformed( ActionEvent ae ){
            dispose(); // close the window or write any code that you want here.
        content.add( cancel );
        pack( ); // pack everything in the dialog for display.
        show(); // show the dialog.

  • Reading values from JTable

    I have som problems reading the values from JTable. the user enters a number in the table, but some cells are empty. I want to store the values in an int array, and if the user has not filled a cell it is supposed to be set as zero. Now I cant seam to get it right.
    I get the error message: Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: null
    It is for the code. Integer intObj = new Integer(str);[/u
    int[] tmp = new int[brettStorelse * brettStorelse];
    for (int i = 0; i < brettStorelse; i++) {
         for (int j = 0; j < brettStorelse;j++) {
              String k = String.valueOf(j+i);
              int l = Integer.parseInt(k);
              if (sudokuTabell.getValueAt(i, j) != null) {
                   String str = (String) sudokuTabell.getValueAt(i+1, j+1);
                   Integer intObj = new Integer(str);
                   tmp[l] = intObj.intValue();
                   System.out.println(tmp[l]);
              } else {
                   tmp[l] = 0;

    What are you doing to prevent the user from entering values in the table that are not parseable? Seems like you should be doing the below.
    int[] tmp = new int[brettStorelse * brettStorelse];
    for (int i = 0; i < brettStorelse; i++) {
         for (int j = 0; j < brettStorelse;j++) {
              String k = String.valueOf(j+i);
              int l = Integer.parseInt(k);
              if (sudokuTabell.getValueAt(i, j) != null) {
                   String str = (String) sudokuTabell.getValueAt(i+1, j+1);
                            try {
                                tmp[l] = Integer.parseInt (str);
                            catch (NumberFormatException e){
                                 tmp[l] = 0;
                   System.out.println(tmp[l]);
              } else {
                   tmp[l] = 0;
    }

Maybe you are looking for

  • Table for production orders

    Dear Gurus In which table can we get the open production order quantities and the gr dates. Regards Sandip Sarkar

  • Agins Report

    Hi. On the account receivable report format there is a column that shows the date. This is a text field and I have tried to figure out how it works, what it does to bring the date information, so I have been unable. I need to know where the dates com

  • Folder name already exists error when activating feature

    HI, I am creating a document library and adding folders to it using elements.xml in VS 2012. First time deployment of the item works fine, the folder is created. But further deployment or activation of feature from site features is throwing the error

  • Accessing PDF files outside the web application

    Hi, I have deployed a web application Tomcat / webapps/ Moto. The Tomcat / webapps / Moto / resource.jsp file has links to a pdf file located outside the Moto web app. The pdf file is in Tomcat / webapps / doc / BAServerConfig.pdf. Now, I'm unable to

  • Help: Oracle8i installation on Linux6.0

    I could use some help with the installation of Oracle8i I have downloaded the single file version of the enterprise and I have gotten JDK116_v5 installed and running. I am new to this.. Can any one help. null