How to send a string from sender to receiver side using java

I am doing a project on Digital Signature.I have already done with the GUI using java swing.
Now i want to send a string from the sender side to the receiver side on the click of a button using socket programming.
Please can anybody provide me with the code as early as possible.

http://catb.org/~esr/faqs/smart-questions.html

Similar Messages

  • How to send HTML Format Mail using Java Mail in oracle 9i Forms

    Dear All
    could you please tell me how to send HTML Format Mail using Java Mail in oracle 9i Forms and how to implement the java mail ?
    if it is possible, could you please send me the sample code? please very urgent
    Thanks
    P.Sivaraman

    Hello,
    <p>Here is a Form sample.</p>
    Francois

  • How to send results to actionscript using java

    Hi,
    I do RPC using HttpService.
    In my situation, I need to send results from Java code to
    Flex Action script. I have defined a Java Servlet receiving data
    from Flex application, then it processes with the data, finally the
    Servlet is supposed to send some feedbacks to the client(Flex).
    My question is that how can I define codes in doPost() method
    that the following function will get "result" from the Java side.
    public static function httpResult(event:ResultEvent):void
    var result:Object = event.result;
    //Do something with the result.
    if (result.toString() == "success")
    resultMessage.text = "Login Success";
    resultMessage.text = "Invalid User";
    }

    Hi,
    Try this: If you are sending a simple text as "sucess" or
    "error" after doing some process in the servlet..
    set your content type to "text/plain" and simply
    println(<data to be sent>);
    In the flex application, get the result text that the servlet
    send using:
    resultString = String(httpUrl.lastResult);
    where httpUrl is the id of the HTTPService. Now you can
    compare what the servlet send by:
    if(resultString=="sucess") {
    Hope this solves your problem :)
    Regards,
    -- Abdel Olakara
    http://olakara.googlepages.com
    http://technopaper.blogspot.com

  • How to send results to actionscript using java via HttpService

    Hi,
    I do RPC using HttpService.
    In my situation, I need to send results from Java code to
    Flex Action script. I have defined a Java Servlet receiving data
    from Flex application, then it processes with the data, finally the
    Servlet is supposed to send some feedbacks to the client(Flex).
    My question is that how can I define codes in doPost() method
    that the following function will get "result" from the Java side.
    public static function httpResult(event:ResultEvent):void
    var result:Object = event.result;
    //Do something with the result.
    if (result.toString() == "success")
    resultMessage.text = "Login Success";
    resultMessage.text = "Invalid User";
    }

    I advise having your servlet build an xml string, maybe put a
    status attribute in the root tag, like this:
    <myroot status="success">
    <mytext>Some text</mytext>
    </myroot>
    and return that to the calling Flex client. XML is easier to
    work with than Object. On the HTTPService tag, set
    resultFormat="e4x", and it will return plain XML.
    then in the handler, do:
    var xmlResult:XML = XML(event.result); //this will already be
    the myroot node
    //Do something with the result.
    if (xmlResult.@status== "success") //reads the status
    attribute
    resultMessage.text = xmlResult.mytext.text(); //get the
    value of themytext text() node
    resultMessage.text = "Error";
    Tracy

  • How to send images through PI using SOAP adapter

    hi,
    Can anybody tell me how to send images through PI using SOAP adapter.
    Regards ,
    Loveena

    Hi Loveena,
    only as attachments of a SOAP message.
    Regards,
    Udo

  • How to send a https request using jsf

    hi
    Can anybody tell a sample how to send a https request using JSF ...
    thanks

    Prefix the request URI with the https protocol.
    The answer is too easy and straightforward that I guess that you mean something else. If you just want to know how to configure an SSL environment for your own webapplication, refer to the Java EE tutorial chapter 28: http://java.sun.com/javaee/5/docs/tutorial/doc/

  • How to convert a string from upper case to lower case in FOX formula

    Hi Experts,
    How to convert a string from upper case to lower case in FOX formula?
    Thanks,
    Cheers!!!
    PANKAJ

    The last result.append( c ) should be:
    result.append( Character.toLowerCase(c) );

  • How to convert a string from lower case to upper case withour using transla

    Hi all,
    how to convert a string from lower case to upper case withour using translate,
    Thanks in Advance,
    Reddy

    Refer to this related thread
    Re: hi guys this very urgent please help

  • How to transfer a string from sub sequence to main sequence

    Hi,
    How to transfer a string from sub sequence to main sequence, My main sequence has included a sub sequence, the sub sequence is return a string value after running done, I need to get this string value from sub sequence to main sequence, I check the defined that look like seem the two
    sequence have themself local variable,but I don't know how to defined a globe variable to cover main sequence and sub sequence like VC++'s Main App ,Please kindly help me,thanks in advance...

    Hi,
    I hope this small example will help you.
    Regards
    Ray Farmer
    Regards
    Ray Farmer
    Attachments:
    Sequence File1.seq ‏36 KB

  • How to read a string from file & assign the val to a variable in batch file

    Hi,
    How to read a string from a file and assign the value to a variable then return the value to the screen in windows batch file?
    Any suggestions?
    thanks.

    Unless this is a homework question then I don't see the purpose of doing this, but....
    You should be looking a the supplied package utl_file to get the string out of the file, dbms_output to display the string and then google windows batch/command files calling sqlplus to execute your program.
    Andre

  • How to search a string from the database?

    how to search a string from the database? starting with some character

    If you're trying to do this in a SELECT, you can use the LIKE verb in your WHERE clause.
    Here's an Example
      SELECT obj_name FROM tadir
        INTO prog
        WHERE pgmid = 'R3TR'
          AND object = 'PROG'
          AND obj_name LIKE 'Z%'.
    In this case it will select every row that obj_name starts with Z. 
    If you wanted to find every row that the field obj_name contains say... 'WIN'  you use LIKE '%WIN%'.
    Edited by: Paul Chapman on Apr 22, 2008 12:32 PM

  • How to build a String from Date?

    How to build a String from class Date?
    How to get the year, month, day, hour ... from a Date object.

    Ok to build a string use this function in java.util.Date
    toString()
    TO get year, date, etc u can use the following functions
    getYear()
    getDate()
    This link might help u more
    http://java.sun.com/products/jdk/1.1/docs/api/java.util.Date.html

  • Sending an e-mail using java

    Hi,
    I am sending an e-mail using java. It works fine, but I wanted to know if there is any possibility to attach a document, without using a File object. Because I have to write the File object and then delete it at the end. I would like to know if I can use for example a byte [], or something else.
    Thank you very much.
    This is my code, if that helps.
    public static void sendWithAttach(String p_sender, String p_receiver, String p_subject,
    String p_comment, int p_nombrePiecesJoints, HashMap<String, byte[]> p_files) {
    Properties props = System.getProperties();
    props.put("mail.smtp.host", Solapcore.getCurrent().getServletConfig().getServletContext().getInitParameter("SMTP"));
    Session session = Session.getDefaultInstance(props, null);
    MimeMessage sender = new MimeMessage(session);
    MimeBodyPart mbp1 = new MimeBodyPart();
    Multipart mp = new MimeMultipart();
    List<File> listeFiles = new ArrayList<File>();
    try {
    //On assigne to, from, subject, body, priority
    sender.setRecipients(javax.mail.Message.RecipientType.TO,
    InternetAddress.parse(p_receiver, false));
    sender.setFrom(new InternetAddress(p_sender));
    sender.setSubject(p_subject);
    mbp1.setText(p_comment);
    //sender.setPriority(0);
    mp.addBodyPart(mbp1);
    //On attache les documents
    for(Map.Entry<String, byte[]> entry : p_files.entrySet()) {
    MimeBodyPart mbp2 = new MimeBodyPart();
    String fileName = entry.getKey();
    byte [] dataFile = entry.getValue();
    File file = new File(fileName);
    FileOutputStream fos = new FileOutputStream(file);
    fos.write(dataFile);
    mbp2.attachFile(file);
    mbp2.setFileName(fileName);
    mp.addBodyPart(mbp2);
    listeFiles.add(file);
    sender.setContent(mp);
    Transport.send(sender);
    }catch(MessagingException mex) {
    mex.printStackTrace();
    }catch(FileNotFoundException fnf) {
    fnf.printStackTrace();
    }catch(IOException ioe) {
    ioe.printStackTrace();
    }finally {
    Iterator<File> itListeFiles = listeFiles.iterator();
    while(itListeFiles.hasNext()) {
    File tempFile = (File)itListeFiles.next();
    tempFile.delete();
    }

    Thank you very much.
       public static void sendWithAttach(String p_sender, String p_receiver, String p_subject,
          String p_comment, int p_nombrePiecesJoints, HashMap<String, byte[]> p_files) {
        Properties props = System.getProperties();
        props.put("mail.smtp.host", Solapcore.getCurrent().getServletConfig().getServletContext().getInitParameter("SMTP"));
        Session session = Session.getDefaultInstance(props, null);
        MimeMessage sender = new MimeMessage(session);
        MimeBodyPart mbp1 = new MimeBodyPart();
        Multipart mp = new MimeMultipart();
        List<File> listeFiles = new ArrayList<File>();
        try {
          //On assigne to, from, subject, body, priority
          sender.setRecipients(javax.mail.Message.RecipientType.TO,
              InternetAddress.parse(p_receiver, false));
          sender.setFrom(new InternetAddress(p_sender));
          sender.setSubject(p_subject);
          mbp1.setText(p_comment);
          //sender.setPriority(0);
          mp.addBodyPart(mbp1);
          //On attache les documents
          for(Map.Entry<String, byte[]> entry : p_files.entrySet()) {
            MimeBodyPart mbp2 = new MimeBodyPart();
            String fileName = entry.getKey();
            byte [] dataFile = entry.getValue();
            File file = new File(fileName);
            FileOutputStream fos = new FileOutputStream(file);
            fos.write(dataFile);
            mbp2.attachFile(file);
            mbp2.setFileName(fileName);
            mp.addBodyPart(mbp2);
            listeFiles.add(file);
          sender.setContent(mp);
          Transport.send(sender);
        }catch(MessagingException mex) {
          mex.printStackTrace();
        }catch(FileNotFoundException fnf) {
          fnf.printStackTrace();
        }catch(IOException ioe) {
          ioe.printStackTrace();
        }finally {
          Iterator<File> itListeFiles = listeFiles.iterator();
          while(itListeFiles.hasNext()) {
            File tempFile = (File)itListeFiles.next();
            tempFile.delete();
        }

  • Can any one please send me sample programs using java mapping..

    <b>Can any one please send me sample programs using java mapping with input and output?</b>
    please let me know how to get started with java mapping?
    Prerequisites for java mapping ?
    What are the jars need to be deployed for SAX,DOM.  And how to do it in NWDS?
    Use of Execute() and setparameter() ... StreamTransformation?
    Some sample program using java mapping with simple logic(input and output)?

    Hi,
    Did you go thro these blogs?
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
    Nice blogs to start Java Mapping.
    Go thro this one too.
    /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
    Regards,
    P.Venkat
    Message was edited by:
            Venkataramanan

  • How do i transfer music from one ipod to another using itunes

    how do i transfer music from one ipod to another using itunes

    Welcome to the Apple Community.
    There is more than one way, but to get it all on all devices, connect the first device to iTunes and choose to transfer the music from the device from the file menu. Once everything is in iTunes connect the second device, select the device in the device list, navigate to the music tab and check the content you wish to sync, click apply/sync.

Maybe you are looking for