Recieving an HTML POST

I'm hoping someone can lead me in the right direction.
My app is alittle webserver that generates the html files on the fly the generated html includes varibles from the program. For example a generated webpage would generate a html file such as:
<HTML>
Varable1 = true
Variable2 =false
Varible3 =false
</HTML>
What I'd like to do is make the generated page include a button next to each variable pair that when pressed would send a POST or GET to the server, which the server would then receive and use to change the state on the variable.
Any suggestions on how to go about this? I'm thinking that I may just have to parse the GET or POST's and handle it that way. But I'm wondering if there is an easier way to do this.
Any opinion or a point in the right direction would be great
Xavier

generated page include a button next to each variable pairIt seems you should learn to write basic HTML FORM and its various input elements. Handling them from server via servlet is just easy.

Similar Messages

  • Generate html post request from form9i applet

    I need to interact with a 3rd party credit card processing server form my form9i application.I need to create a html post request with all the input information encapsulated in it and also receive the http response and parse it and display an alert in the form(approved or rejected).Can I do that?
    any answer is going to help me greatly
    Sathi

    GET method may be the easier way. web.show_document('your_url?v1=123&v2=abc'); as of POST method, I guess you need JSP to do it, but how to do it from applet, I like to know too.
    getting back info, I used perl to read the html POST data on web server, then perl parses it and writes to a file on server, then use text_io or utl_file to read data into webform applet fields.
    The drawback I found that the cursor will not get back to webform applet from html pages. I tried to print every possible Javascript methods to wake up it, but it cannot get it.

  • HTML Post method.

    HI Experts,
    Here my scenario is Proxy to HTTP.
    My Receiver system need HTML Post method in place of XML file. Normally PI will send the XML but receiver system is expecting HTML POST method.
    For this i have to do in configuration.
    Receiver is expecting below format.
    <html>
    <head>
    <title>Authorize</title>
    </head>
    <body>
    <form action="https://developer.skipjackic.com/scripts/evolvcc.dll?AuthorizeAPI" method="post" >
         SerialNumber<input type="text" name="serialnumber" value="000014661324"><br />
         DeveloperSerialNumber<input type="text" name="developerserialnumber" value="464787130566"><br />
         Sjname<input type="text" name="sjname" value="TSYS Test"><br />
         street address<input type="text" name="streetaddress" value="2230 Park Ave"/><br />
         city<input type="text" name="city" value="Cincinnati"/><br />
         state<input type="text" name="state"  value="OH"/><br />
         zipcode<input type="text" name="zipcode"  value="45206"/><br />
         credit card account number<input type="text" name="accountnumber" value="4445999922225"/><br />
         CVV2<input type="text" name="CVV2" value=""><br>
         expiration month<input type="text" name="month" value="12"/><br />
         expiration year<input type="text" name="year" value="2012"/><br />
         amount<input type="text" name="transactionamount" value="1.00"/><br />
         order number<input type="text" name="ordernumber" value="123"/><br />
         phone<input type="text" name="shiptophone" value="8883688507"/>
      orderstring<input type="text" name="orderstring" value="Test1Test Item 13.001N||210.001N||310.001N||410.001N||510.001N~||" /><br />
         <br />
         <input type="submit" value="submit" />
    </form>
    </body>
    </html>
    Thank you
    Srinivas

    Hi Srinivas,
    I have the same issue with Form submit using Java HTTP adapter.
    It would be great if you can share your java mapping code or advise what should be the outcome of java mapping?
    Should the result of java mapping be some kind of XML payload or some html code ?
    Many Thanks,
    Kind Regards
    Ravi

  • Generate a HTML POST url and open the page.

    Hello,
    I need to generate a HTML POST url with 4 parameters.
    I tried like this.
    String URLtobeOpened = "<url>?param1=val1&param2=val2&param3=val3&param4=val4";
              HttpServletResponse resp = request.getServletResponse(true);
              try {
                   resp. sendRedirect(URLtobeOpened);
              } catch (IOException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
    This is showing me a login prompt, instead of directly logging me in.
    Also when I checked using HTTPWatch, the request is showing as a GET, but I need it as a POST.
    How to code it in the right way.
    Thanks
    Srinivas

    Here is what I tried sofar
    I am using this jar commons-httpclient-3.1.jar
    import org.apache.commons.httpclient.HttpClient;
    import org.apache.commons.httpclient.methods.PostMethod;
              String url = "https://www.independentinc.com/scripts/insupport.exe/db_connect";
                try {
                 HttpClient client = new HttpClient();
                 PostMethod method = new PostMethod( url );
                   // Configure the form parameters
                   method.addParameter( "param1", "val1" );
                   method.addParameter( "param2", "val2" );
                   method.addParameter( "param3", "val3" );
                   method.addParameter( "param4", "val4" );
                   // Execute the POST method
                 int statusCode = client.executeMethod( method );
                 if( statusCode != -1 ) {
                    String contents = method.getResponseBodyAsString();
                    method.releaseConnection();
    //                System.out.println( contents );
                catch( Exception e ) {
                 e.printStackTrace();
                }I am getting a weird exception
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at
    HttpClient client = new HttpClient();How to fix this exception...
    Is this the right approach at all...

  • Http-adapter: Convert html-post to JAVA-post?

    Hello everybody,
    unfortunately I am not a java programmer. But I am testing the http adapter.
    Is it possible to convert the following html-post into JAVA code?
    <html><head>
    <body>
    <form action="http://myserver" method="post">
    <p>Interface Namespace<br>
    <input name="namespace" value="http://mum.mappings" size="40"></p>
    <p>(Sender-) Service:<br>
    <input name="service" value="MUMHTTP" size="40"></p>
    <p>Interface Name:<br>
    <input name="interface" value="MI_Merge_1" size="40"></p>
    <p>Text:<br>
    <textarea name="Text" rows="5" cols="50"></textarea></p>
    <p><input type="submit" value="Send"></p>
    </form>
    </form>
    </body>
    </head>
    </html>
    For me it is important to send the values of the <input> values.
    How has the code look like?
    Many regards, mario

    Hi Mario,
    I Have once used this code snippet to send a payload to XI engine. Please change the parameters like XI server URL,
    Namespace,senderservice etc..
    Please let me know if you need any further help.
    Regards,
    Ananth
    public static void main(String[] args) throws Exception {
         try {
              URL sapURL = null;
              String urlString = "http://"+serverHost+":"+serverPort+"/sap/xi/adapter_plain?namespace="+senderNamespace+"&interface="
    +senderInterface+"&service="+senderservice+"&party=&agency=&scheme=&QOS="+QOS+"&sap-user="+sapUser+"&sap-password="+
    sapPWD+"&sap-client="+client+"&sap-language=E";
              sapURL= new URL(urlString);
              HttpURLConnection xi = (HttpURLConnection)sapURL.openConnection();
              xi.setRequestMethod("POST");
              xi.setRequestProperty("Content-Type","text/xml");
              xi.setDoOutput(true);
              generateXML(xi.getOutputStream());
              System.out.println(urlString);
              System.out.println("Resp Msg:"+xi.getResponseMessage()+" -- Resp Msg:"+xi.getResponseCode());
              xi= null;
         } catch (Exception e) {
                   e.printStackTrace();
    public static void generateXML(OutputStream out){
         try {
              PrintWriter prt = new PrintWriter(out,false);
              //Create XML tags
              prt.println("<?xml version= "1.0"?>");
              prt.print("<"+resp_MsgType+" xmlns:ns=""+resp_NameSpace+"">");
              prt.print("<"+xml_tag1+">");
              prt.print(xml_tagValue1);
              prt.print("</"+xml_tag1+">");
              prt.print("<"+xml_tag2+">");
              prt.print(xml_tagValue2);
              prt.print("</"+xml_tag2+">");
              prt.print("</"+resp_MsgType+">");
              prt.flush();
              prt.close();
              out.close();
              prt=null;
              out=null;
              }catch(Exception e){
                   e.printStackTrace();

  • Convert html-post to JAVA-post?

    Hello everybody,
    unfortunately I am not a java programmer.
    Is it possible to convert the following html-post into JAVA code?
    <html><head>
    <body>
      <form action="http://myserver" method="post">
        <p>Interface Namespace<br>
        <input name="namespace" value="http://mum.mappings" size="40"></p>
        <p>(Sender-) Service:<br>
        <input name="service" value="MUMHTTP" size="40"></p>
        <p>Interface Name:<br>
        <input name="interface" value="MI_Merge_1" size="40"></p>
        <p>Text:<br>
        <textarea name="Text" rows="5" cols="50"></textarea></p>
        <p><input type="submit" value="Send"></p>
      </form>
    </form>
    </body>
    </head>
    </html>
    For me it is important to send the values of the <input> values.
    How has the code look like?
    Many regards, mario

    mario,
    this is possible if you use something like HttpClient
    check
    http://jakarta.apache.org/commons/httpclient/
    for more details.
    here are few examples of using httpclient for posting data
    http://jakarta.apache.org/commons/httpclient/methods/post.html
    Rgds,
    Amol

  • Trying to Imitate the html POST  method with an applet

    I am trying to imitate the POST method with an applet, so that I can eventually send sound from a microphone to a PHP script which will store it in a file on a server. I am starting out by trying to post a simple line of text by making the PHP script think that it is receiving the text within a POST-ed file. The reason I am doing things this way is in part because I am, for the time being, limited to a shared server without any support for servlets or any other server side java.
    The code I am trying is based in part on an old thread found elsewhere in this forum, concerning sending data to a PHP file by imitating the POST method:
    link:
    http://forum.java.sun.com/thread.jspa?threadID=530399&messageID=2603608
    someone named "harmmeijer" provided most of the answers on that thread. If that person is still around hope they take a look at this,also I have some questions to clarify what they said on the other thread..
    My first attempt at code is below. The applet is in a signed jar file and is trying to pass a text line to the PHP script in the same directory and on the same server that the applet came from. It is doing this by sending header information that is supposed to be identical to what an html form would send if it was uploading a .txt file with the line of text within it. The applet displays one button. When you press it, it sucessfully starts up the postsim method (defined at the end), which is supposed to send the info to the PHP script at the server.
    I have two questions:
    1) I know that the PHP script is starting up, because it prints out a few messages depending on what happens. However, the script does not recognize any file coming down the line, so it does not save anyting on the server, and prints out a message saying the no file was uploaded.
    Any idea what might be going wrong? I'm not getting any error messages from the applet. I've tried a few different variations of the 'header' information contained in the line:
    osToServer.writeBytes("--****4353\r\nContent-Disposition: form-data; name=\"testfile\"; filename=\"C:testfile.txt\"\r\nContent-Type: text/plain\r\n");
    The commented out line below it shows one variation (which was given in the thread mentioned above).
    2) You'll notice that I've commented out the two lines having to do with the input line:
    //InputStream isFromServer;
    and
    //isFromServer = uc.getInputStream();
    The reason is that the program crahes whenever I put the latter line in - to the extent that Opera closes down the JVM and then crashes when I tried to exit it.. I must be doing something horribly wrong there! I first tried using isFromServer = new DataInputStream(uc.getInputStream());
    becuase it was consistent with the output stream, but that caused the same problem.
    Here's the code:
    public class AudioUptest1 extends Applet{
    //There are a few spurious things defined in this section, having to do with the fact the microphone data is evenuatly going to be sent. haven't yet insterted code to get input from a microphone.
    AudioFormat audioFormat;
    TargetDataLine targetDataLine;
    SourceDataLine sourceDataLine;
    DataOutputStream osToServer;
    //InputStream isFromServer;
    URLConnection uc;
    final JButton captureBtn = new JButton("Capture");
    final JPanel btnPanel = new JPanel();
    public void init(){
    System.out.println("Started the applet");
    try
    URL url = new URL( "http://www.mywebsite.com/handleapplet.php" );
    uc = url.openConnection();
    //Post multipart data
    uc.setDoOutput(true);
    uc.setDoInput(true);
    uc.setUseCaches(false);
    //set request headers
    uc.setRequestProperty("Connection", "Keep-Alive");
    uc.setRequestProperty("HTTP_REFERER", "http://applet.getcodebase");
    uc.setRequestProperty("Content-Type","multipart/form-data; boundary=****4353");
    osToServer = new DataOutputStream(uc.getOutputStream());
    //isFromServer = uc.getInputStream();
    catch(IOException e)
    System.out.println ("Error etc. etc.");
    return;
    //Start of GUI stuff
    captureBtn.setEnabled(true);
    //Register listeners
    captureBtn.addActionListener(
    new ActionListener(){
    public void actionPerformed(
    ActionEvent e){
    captureBtn.setEnabled(false);
    //Postsim method will send simulated POST to PHP script on server.
    postsim();
    }//end actionPerformed
    }//end ActionListener
    );//end addActionListener()
    add(captureBtn);
    add(btnPanel);
    // getContentPane().setLayout(new FlowLayout());
    // setDefaultCloseOperation(EXIT_ON_CLOSE);
    setSize(250,70);
    setVisible(true);
    }//end of GUI stuff, constructor.
    //These buffers might be made larger.
    byte tempOutBuffer[] = new byte[100];
    byte tempInBuffer[] = new byte[100];
    private void postsim(){
    System.out.println("Got to the postsim method");
    try{
    //******The next four lines are supposed to imitate a POST upload from a form******
    osToServer.writeBytes("--****4353\r\nContent-Disposition: form-data; name=\"testfile\"; filename=\"C:testfile.txt\"\r\nContent-Type: text/plain\r\n");
    //osToServer.writeBytes("Content-Disposition: form-data; name=\"testfile\"; filename=\"C:testfile.txt\"\r\nContent-Type: text/plain\r\n");
    //This is the text that's cupposed to be written into the file.
    osToServer.writeBytes("This is a test file");
    osToServer.writeBytes("--****4353--\r\n\r\n");
    osToServer.flush();
    osToServer.close();
    catch (Exception e) {
    System.out.println(e);
    System.out.println("did not sucessfully connect or write to server");
    System.exit(0);
    }//end catch
    }//end method postsim
    }//end AudioUp.java

    Hi All,
    I was trying to write a signed applet that helps the
    user of the applet to browse the local hard disk and
    select a file from the same. The JFileChooser class
    from Swing is what I used in my applet. The problem
    is with the policy file. I am not able to trace the
    exact way to write a policy file which gives a total
    access to read,write,delete,execute on all the drives
    of the local hard disk.
    I am successful in signing the applets and performing
    operations : read,write,delete & execute on a single
    file but failing to grant permission for the entire
    file.
    Any help would be highly appreciated.Which policy file are you using? there might be more than one policy file.
    also, u have to specify the alias of the signed certificate in the policy file to grant the necessary priviledges to the signed applet.

  • HTML POST method in a dynamic page

    Greetings Portalists,
    I have a basic question here. I need to pass the values of an html form (constructed within a dynamic page) to a procedure to process the users' inputs. The form is highly dynamic in terms of numbers of parameters, but we're talking about upwards of 200 text fields that require passing. Now, I realise that this in itself isn't a problem, and I've set this up without too much difficulty using method="POST" - but the called procedure in the form's action=... attribute seems to need to be publicly-executable for this scenario to work. For a production environment, I don't want to keep the PUBLIC grant on the procedure, but whenever I revoke it, the Portal throws me back a 404 Not Found when I submit the form.
    So my question is this -- how can I tighten the security around executing the procedure? Are there any best practices for this sort of situation (which I can't imagine are all that rare)?
    I've searched through many various web toolkit and Portal documents looking for an answer to this but to no avail, so any suggestions really would be highly appreciated.
    Many thanks.
    *.s.*

    Granting execute to public make a procedure accessible to portal_public (the schema) which contains the mappings to all the authenticated light-weight users. You can keep the public or portal_public grant for execution on the procedure and yet have a good control on who would be able to see your form. That would be based on your pl/sql logic.
    For instance, if you wish to keep it for only authenticated users (users who are in registered with your portal) or with any certain group of users, you can always apply a block containing code for checking their group memberships. If a user belongs to your desired group, you can let the desired logic expose to them, otherwise not.
    Please check the portal pl/sql api's that come with portal version you are using, for help.
    AMN

  • Need help submitting an HTML Post command

    Hi Everyone,
    I need a help submitting a POST command to an Apache Server. I unfortunately have almost no expierience with HTML. Can anyone give me a simple example to start with and what I might need to do?
    Thank you very much in advance,
    Oz
    Message Edited by OzRuiz on 12-18-2007 09:18 AM
    Message Edited by OzRuiz on 12-18-2007 09:21 AM

    This is actually very simple with native LabVIEW functions.
    Use an TCP Open Connection to open a port to the server (I used
    ws.cdyne.com, with port 80).
    Send your request with TCP Write (I send the text listed below. This text is
    copied directly from the ws.cdyne.com web page, where you can find examples
    for POST, GET and others).
    Read back the data with TCP Read.
    Close the connection with TCP Close Connection.
    Note that the data you send and receive doesn't need to be HTML. It could be
    any text, but most likelly XML or HTML. In this case it's a soap message,
    basically an XML format designed for communicating with servers. Some
    servers send the data back in several parts, but I have not found any
    describtion about this format.
    Regards,
    Wiebe.
    +++++++++++++++++++++++++++++
    POST /ip2geo/ip2geo.asmx HTTP/1.1
    Host: ws.cdyne.com
    Content-Type: text/xml; charset=utf-8
    Content-Length: 391
    SOAPAction: "http://ws.cdyne.com/ResolveIP"
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <ResolveIP xmlns="http://ws.cdyne.com/">
    <IPaddress>62.250.4.144</IPaddress>
    <LicenseKey>0</LicenseKey>
    </ResolveIP>
    </soap:Body>
    </soap:Envelope>
    ++++++++++++++++++++++

  • Difficulty replicating simple HTML POST in AS3

    Hi,
    I'm trying to post a username and password to a server side script.  The client provided an HTML form that demonstrates that the sever side functionality is working, but I keep getting the following:
    <response>
    Invalid UserName / Password Combination
    </response>
    Here's the HTML code:
    html> 
    Here's what I have been doing in AS3:
    var loader:URLLoader = new URLLoader();
    configureListeners(loader);
    var header:URLRequestHeader = new URLRequestHeader("pragma", "no-cache");
    var request:URLRequest = new URLRequest("http://sitename.net/login");
    request.data = new URLVariables();
    request.data.username = "username";
    request.data.password = "password";
    request.method = URLRequestMethod.POST;
    request.requestHeaders.push(header);
    try {
    loader.load(request);
    } catch (error:Error) {
    trace("Unable to load requested document.");
    Any insight would be appreciated.
    Best regards,
    Chris McLaughlin

    Hi,
    Well I have to say the apersand in the html code kept getting my attention and that is where the answer lies.  It means that instead of passing 2 values as I was doing you have to pass 1 and you have to know how to URL encode the amersand which of ocurse I did not know.
    So it's like this:
         request.data= "username=someName&%26password=somePassword"
    Geez!

  • Html POST action unable to locate servlet

    <p>I am getting error "for host 127.0.0.1 trying to POST /fileReceiverServlet, send-file reports: HTTP4142: can't find C:/Sun/AppServer7/domains/domain1/server1/docroot/fileReceiverServlet (File not found)" when trying to invoke servlet from html client using POST action method.
    <p>
    war file distribution and validation gets done without any error, also
    have servlet deployed on the SunOne 7 appserver
    <p>
    web.xml servlet decalration looks like -
    <web-app>
    <display-name>Web Application - TGCWA file upload</display-name>
    <description>WebApplication for TGCWA file upload</description>
    <context-param>
    <param-name>file.root</param-name>
    <param-value>/loader</param-value>
    </context-param>
    <servlet>
    <servlet-name>FileReceiverServlet</servlet-name>
    <display-name>File Receiver Servlet</display-name>
    <description>Servlet for receiving docs </description>
    <servlet-class>mmm.abcd.tomm.cca.fileUpload.FileReceiverServlet</servlet-class>
    <!--<init-param>
         <param-name>mmm.abcd.tomm.cca.fileUpload.host</param-name>
         <param-value>127.0.0.1</param-value>
    </init-param>
    <init-param>
         <param-name>mmm.abcd.tomm.cca.fileUpload.port</param-name>
         <param-value>3781</param-value>
    </init-param> -->
    </servlet>
    <servlet-mapping>
    <servlet-name>FileReceiverServlet</servlet-name>
    <url-pattern>/fileReceiverServlet</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>20</session-timeout>
    </session-config>
    <welcome-file-list>
    <welcome-file>FileLoad.jsp</welcome-file>
    </welcome-file-list>
    </web-app>
    <p>
    Please let me know, what am I missing or area I shld look into.
    <p>
    TIA

    I think you are posting to "/FileReceiverServlet", remove the front slash.

  • How to know a recievable invoice is posted or not.

    Hi,
    I am using following query to know whether a invoice is posted or not.
    SELECT 1
    FROM ra_cust_trx_line_gl_dist_all RCTG
    WHERE RCTG.posting_control_id=-3
    AND RCTG.customer_trx_id=RCT.customer_trx_id
    But this is returning '1' even when the GL batch status is 'unposted'.
    Apps version: 11.5.10
    Using 'General Ledger Transfer Program' concurrent program to to post the invoice to GL.
    Is this the correct query, please suggest.
    Thanks & Regards,
    Syed.

    Thanks for the quick reply octavio,
    That was part of Query i provided in the previous post. Here is the complete query.
    Requirement:
    Fetching all open invoices which are posted, not applied. But this is still fetching the invoice which are not posted. Please suggest.
    SELECT RCT.customer_trx_id,
    RCT.org_id,
    TO_CHAR(RCT.last_update_date,'RRRR-MM-DD HH24:MI:SS') LastUpdateDate
    FROM ra_customer_trx_all RCT,
    ra_cust_trx_types_all RCTTA
    WHERE RCT.complete_flag='Y'
    AND RCT.status_trx='OP'
    AND NOT EXISTS (SELECT 1
    FROM ar_receivable_applications_all ARP
    WHERE ARP.applied_customer_trx_id = RCT.customer_trx_id
    AND ARP.application_type='CASH'
    AND ARP.display='Y'
    HAVING SUM(ARP.amount_applied) > 0
    AND NOT EXISTS (SELECT 1
    FROM ra_cust_trx_line_gl_dist_all RCTG
    WHERE RCTG.posting_control_id=-3
    AND RCTG.customer_trx_id=RCT.customer_trx_id)
    AND NOT EXISTS (SELECT 1
    FROM ar_receivable_applications_all ARP
    WHERE ARP.applied_customer_trx_id = RCT.customer_trx_id
    AND ARP.application_type='CM'
    AND ARP.display='Y'
    HAVING SUM(ARP.amount_applied) > 0)
    AND RCTTA.cust_trx_type_id = RCT.cust_trx_type_id
    AND RCTTA.org_id = RCT.org_id
    AND RCTAA.type IN ('INV','CM')
    Thanks&Regards,
    Syed.

  • REPLY to xsl:output method="html" posting

    Due to a problem with the discussion software, I cannot reply to postings
    with a less-than sign in the Subject!
    As you can imagine in an XML forum where
    angle-brackets are common, this is a real
    pain! The OTN guys tell me they are
    working on a solution.
    We fully support all options of <xsl utput>
    The problem here is that your XSL Stylesheet must be a well-formed XML document, so everywhere you are using the <BR> element, you need to use
    instead.
    <xsl utput method="html"/> requests
    that when the XSLT Engine writes out
    the result of your transformation,
    is a propert HTML document.
    what the XSLT engine reads in must
    be well-formed XML.

    Sorry for jumping in on this thread, but I have a question regarding you reply. I have an XSL stylesheet that preforms XML to HTML conversion. Everything works correctly with the exception of those HTML tags that are not weel formed. Using your example if I have something like:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html"/>
    <input type="text" name="{NAME}" size="{DISPLAY_LENGTH}" maxlength="{LENGTH}"></input>
    </xsl:stylesheet>
    It would render HTML in the format of
    <HTML>
    <input type="text" name="in1" size="10" maxlength="20"/>
    </HTML>
    While IE can handle this Netscape can not. Is there anyway to generate completely cross browser complient HTML with XSL?
    Thanks!

  • HTML POST events in JTextPane

    Hi all
    I've got a real problem here:
    I've implemented a website which is to be used both by a browser directly, and also using an embedded browser within our application.
    I finished the standalone browser version, and assumed that the embedded one would be as easy as pointing a JEditorPane at the site.
    But how wrong I was :-0
    I have used a JTextPane and pointed it at the URL of the site, and added a hyperlink listener to handle the link clicks. At first I had some problems with CSS, but I've managed to overcome those by using the methods of HTMLEditorKit. My big problem now is that the JTextPane doesn't seem to provide support for SUBMIT, POST events etc, and my site relies heavily on these.
    Does anyone know of a component that supports this? Or some code which can be plugged in to a JEditorPane to make it work?
    I found some information on this here:
    http://forum.java.sun.com/thread.jspa?forumID=257&threadID=414212
    The user nfalck very helpfully demonstrates how to gain access to the Java representations of the OPTION, SUBMIT elements etc within the Document object, and suggests that you can manually store them and pass them to the URL.
    I am under severe time pressure though, so I wonder if anyone knows a way to achieve this using existing code / components.
    Thanks in advance for any help.
    Cheers,
    Paul

    Thanks.
    I've seen that thread already actually. I did try using the jdic library and I got it working well, but I found that I got a few native crashes in the DLL's. I cannot risk that kind of thing happening in production deployments...
    From looking around it seems that the POST stuff worked in JDK 1.4 but not in 1.5 - I think that explains why it works for some users and not for others. That's annoying, as I need to embed this browser in two different applications - one of which uses 1.4 and one uses 1.5!
    The last link on that page is dead but I discovered that it points to a component called CalPane, but I can't find out if this is a viable browser component to use. It doesn't look like it.
    Message was edited by:
    moschops

  • Arrrgggggghhhhh (MIME in HTML POST)

    I am pulling my hair out here and going round in ever decreasing circles. I cannot believe I am the only person in the world who wants to do this but I haven't been able to find any clues on how to go about this.
    My problem is that I want to recieve a multipart MIME message in a Tomcat servlet. Once recieved I want to parse the message and break it into its component parts. The first part is always some XML, the rest are attachments which will get stowed away into filestore.
    Rather than reinvent the wheel and probabley fail miserably is there anywhere that someone could point me as to use an existing Class or API. I have looked at the JAVAMAIL API but cant seem to see how to convert the string I currently have containing the message into a Message object.
    Any help will be gratefully recieved.
    Thanks

    javax.mail.internet.MimeMessage
    public MimeMessage(Session session, java.io.InputStream is)throws MessagingExceptionConstructs a MimeMessage by reading and parsing the data from the specified MIME InputStream. The InputStream will be left positioned at the end of the data for the message. Note that the input stream parse is done within this constructor itself.
    Parameters:
    session - Session object for this message
    is - the message input stream

Maybe you are looking for