Stream of data from server to client, what is a good form

I am building a small client server app where the server is constantly sending data to the client. The data is such that it readily lends itself to being in key/value pairs. My thought is to basically have the server send out a string of text to the client like "1:name, 2:age, 3:date, 4:salary" and then have the client parse it out. I can have an object, and just make a toString() method that spits out the fields in that way. But...
Do you guys think this is a good way of sending data out. I will only have at most 20 clients running at once, and the data will get no more than say, 50 key/value pairs. Another way I suppose is to convert it to XML, I'd have to read more about it because I'm not exactly sure how to encapsulate data into XML format or how to use Java's DOM API, but perhaps that is overkill, what do you guys think. Also is there an existing Java parsing API out there already, somethign that I haven't found, that would make all of this very easy? As of right now I have to make sure my output stream is in good form, and then still the client will have to do some kludging parsing with commas and what not. Any suggestions would be appreciated.

Today you only want a few key/value pairs but tomorrow you will decide you need a more complex data structure. I would probably use Serialization using ObjectInput/OutputStream or, as you have considered, XML.
If both sides are to be written in Java then I would probably use Serialization.

Similar Messages

  • Pushing data from server into client's JTable

    Hi!
    Here is the scenario:
    Server updates a clients HashMap. Then the TableModel should update it's own data from that HashMap and update its JTable. The user can add/remove/edit rows in the JTable which should update the HashMap too.
    Questions:
    1. Does the TableModel for each update need to create a Object[][] and create a new JTable whenever the HashMap has changed? Or can it use the setValue/getValue methods to get and set the data in the HashMap
    2. Could the data from the user/server be inserted directly into the HashMap and then calling the tableChangedEvent for updating the TableModel and JTable without extra code?
    Thx, for now.
    /KK

    Hi,
    This is a pretty standard thing to have to do when dealing with a Gui in general. Basically any changes anywhere should trigger notification of all interested parties. So that means each table or tree or whatever that contains data that may change should register itself as a listener on the apportiate list. This means that everything that comes from the server should cause all listeners to be notified. Now in a table the best one to notify is the table model not the Gui. You should have your own model not take a default. AbstractTable model is a good place to start. The listener will get updated with something that it knows what to do with. It would be nice if this was the object you are using for your table model(rows) but it sounds like you have to go back to the hashtable to get the object. Then just see if the object is new so add it or exists and update your tablemodel with it. Then do something like
    te = new TableModelEvent(this,loop,loop);
    fireTableChanged(te);
    Well that may not format well here but hope you get the idea. Also you may have to take care to do this on the Gui thread, but I usually wait until I get into trouble before doing that. Anyhow that is pretty easy just take the code create a runnable (abstract type is fine) and throw the offending code into the run() and usually do an InvokeLater since you may be on the Servers thread (JMS , Tibco) and do not want to wait.
    Howie

  • FileDownload, downloading data from Server to Client/Share

    Hello together,
    my Web Dynpro Application shall save 4 Files to the client or to a share.
    If the User presses SAVE DATA on the application, the data should be saved in a table (this is already done) but also the new and the old data should be saved in 4 Files on the client or share, without pressing any other Buttons or something else.
    This new and old data are divided in 4 Files. I already did the file Download with a Button, and on the browser there comes a popup and i can save this files - > but this is not what it should.
    Can somebody please HELP?
    Regards Chris

    Remember you are in a web browser, not a desktop application.  There is a security sandbox that protects the client machine from web browser access.  The only way you are going to get slient downloads of multiple files in Web Dynpro is with the AcfUpDownload UI element in 7.01 and higher. It uses a signed Java Applet to get around the browser security sandbox.
    You sya you need to write this to the clietn or to a share.  Is the file share accessible from the file system of the ABAP application server?  If so you might have a much easier time writing the files to the file share via normal ABAP Dataset commands. This won't involve the browser at all since the ABAP application server will write directly to the file share.

  • How do u get the data from server? if server send by bytes?

    how do u get the data from server? if server send by bytes?
    i have tried using bufferedinputstream to get the data n getting the bytes but there is some data missing.i couldnt all data.so my image cant be display

    If you don't get helpful replies, I suggest you try to improve your question style a bit. There are many non native English speakers around here and the ability to phrase slick sentences varies. But for a start you could try to adhere to minimal English language standards like starting a sentence with an uppercase letter, and ending a sentence with a dot and a blank to separate it from the next sentence. Don't use ellipses (...) all over the place suggesting that the reader knows what you want to say. Rather please say it.
    Its is good style to only post the necessary code to understand the problem. However, the code you posted seems to be cut off too early to even get a grasp at what you are trying to achieve.
    Harald.
    BioMed Information Extraction: http://www.ebi.ac.uk/Rebholz-srv/whatizit

  • Move files from server to client

    I have create txt file in server directory using UTL_FILE package,
    and I put in the directory in server.
    Server platform is linux. and client platform in Windows.
    What I want to ask is there any possibilities to copy that file from server to client using pl/sql ? could all of you "The Gurus" give me a script example ?
    Thanks a lot.
    regards,
    indra

    > What I want to ask is there any possibilities to copy that file from server
    to client using pl/sql
    No. Not really.
    Think about it.. the file is on the server. PL/SQL code executes inside the Oracle server session that is servicing the client.
    Just how is PL/SQL (on the server) suppose to reach out and push that file to a client's file system and directory?
    PL/SQL cannot do this. You need something on the client that will accept the file. You need something in-between the client and PL/SQL that will handle the transfer of the file. This something can be ftp, scp, tftp, NetBIOS etc.
    Anyway you look at this, it does not make sense. You are turning the server into the client that needs to push the file. You are turning the client into a server that needs to accept the file.
    Why? This is contrary to the basic client-server RDBMS architecture. You are adding more complexities and more moving parts to the architecture by forcing a swap of client and server roles. The are now a far greater likelihood of errors and bugs and failures.
    It does not make sense to do it this way.
    What is the business requirement you are trying to satisfy? Instead of us trying to help you to hack a flawed solution, let us rather assist you in determining the correct and proper solution.

  • How can i transfer more than one file from server to client

    Hi,
    our requirement is transfer more than one files from server to client using the
    webutil_file_transfer.as_to_client_with_progress.One file transfer is already working in our system.If anybody know the solution please inform
    regards
    mat

    just an idea ...
    for this purpose let us put aside security concerns and other potential problems....
    -- Get the content of a server directory with Filter and create zip file
    1) create a class that implements java.io.FilenameFilter ...
    2) define accept() method ...
    3) call File.list() with the filter as a parameter. The returned array of strings will have all the names that passed through the accept() filter
    4) use java.util.Zip to create ZIP file on the server side
    -- I think it is better to create this functionality as a separate Java class, put it in required folder and after it
    -- use Forms->Program->"Import Java class" to create pl/sql wrappers, than to create wrappers for all classes and code in pl/sql
    5) use webutil to transfer file on the client
    6) use Java on client side to unzip transferred file
    if you think this is not too complicated, you should try ...
    Regards,
    Vladimir

  • Itunes was unable to load provider data from sync services. What is this?

    When I sync my iphone 3G with itunes, I get message as follows.
    itunes was unable to load provider data from sync services.
    What is this?

    I had nearly the same problem. I am also a user of UltraEdit from IDM Computer Solutions. Are you? My problem was fixed by adjusting to remove a conflict between the two. (both use same-named DLL but different versions.) If this sounds like your issue, post here and I'll reply with more detail.
    -Stephen

  • HT1554 Apparently, I don't know my "com.apple.smig keychain" password. And I'm in the middle of setting up my new Mac mini. I transferred data from my MacBook and what I thought was the password isn't working! Help!!

    Apparently, I don't know my "com.apple.smig keychain" password. And I'm in the middle of setting up my new Mac mini. I transferred data from my MacBook and what I thought was the password isn't working! Help!!

    Hello,
    See if this helps...
    Mac OS X 10.4 Help, I forgot a password in my Keychain
    http://docs.info.apple.com/article.html?path=Mac/10.4/en/mh1960.html
    Mac OS X 10.4: Keychain Access asks for keychain "login" after changing login password...
    http://support.apple.com/kb/HT1631
    Resetting your keychain in Mac OS X...
    If Keychain First Aid finds an issue that it cannot repair, or if you do not know your keychain password, you may need to reset your keychain.
    http://support.apple.com/kb/TS1544

  • Redundant folders created in root of C drive of server and Client . I want to stop the same and want to automatically delete them from server and client .

    Redundant folders created in root of C drive of server and Client . I want to stop the same and want to automatically delete them from server and client .
    Please let me know the solution to delete them not manually . It should not create automatically .Is there a way we can change the path of creation.
    Is there a way that once the folfer is create should be automatically deleted once the task is done.
    Redundant folders are created in the root of my C drive all the time,
    folder names look like:
    09b0508d0bd2dbd70523
    56f51b81c1462bb378009ee4d5ed03
    02afe4378371907aca40ab

    This is a duplicate of
    http://social.technet.microsoft.com/Forums/systemcenter/en-US/ae99c2d0-8dea-4c5e-8a79-17e08e9e5de4/sccm-2012-issue-folders-with-long-guid-are-created-in-c-drive?forum=winservergen#ae99c2d0-8dea-4c5e-8a79-17e08e9e5de4
    Jason | http://blog.configmgrftw.com

  • Can't shown chinese text when copy & paste data from server to Outlook, Word & notepad, etc.( Office 2013)

    Can't shown chinese text when copy & paste data from server to Outlook, Word & notepad, etc.( Office 2013)

    Hi
    As per the information and details provided by you, when you copy & paste a data from server to Outlook, word, notepad, then you do not receive the Chinese text.
    For Outlook, please follow these steps: -
    Close and reopen Outlook in your western locale (or switch the windows system to your Western locale if you changed that),
    Manually change the message from Western to Chinese encoding, which you can do in all versions up to Outlook 2007.
    If you want to stay in your Chinese locale in Outlook 2007, then:
    After you hit reply, go to the Option tab > More Options.
    In the Encoding drop-down menu, select the Chinese encoding you are working in (Not the encoding used by the person who will receive the message)
    Note:
    To set the Chinese locale in all versions up to 2007 the controls are under.
    Tools > Options. In Outlook 2010 File tab > Options > Advanced > International options.
    Unicode (UTF-8)
    is a good setting for multilingual users.
    Check the
    Auto select 2007)/ Automatically select (2010) encoding box.
    I hope this information will be helpful for you.
    Thanks and regards
    Shweta@G 

  • I've set up a form, but don't know how to get data from server?

    Hi
    I've set up a form using Dreamweaver to get peoples names and email addresses but i am unsure how i can get the information to send to my server...and then how i retrieve it?
    This is the code that Dreamweaver wrote;
    <form action="" method="post" enctype="text/p[lain" name="FirstName" target="_blank" id="FirstName">
         <label>First Name
         <input name="First Name" type="text" id="First Name" value="" size="16" />
    </label>
                  <label>Second Name
                  <input type="text" name="Second Name" id="Second Name" />
                                                     <br />
                                                    email address
                  <input name="email address" type="text" id="email address" size="40" />
                  </label>
                                           <input type="submit" name="submit" id="submit" value="Submit" />
    </p>
       </form>
    Any ideas would be greatly welcome!
    Thanks
    Fiona

    Forms do nothing by themselves.  You'll need a script to process the form data.  Ask your host which form to email processing script you can use on your server.  Often they will point you to one.  If they don't, there are some services or 3rd party scripts you can use to collect data from your site.
    WuFoo
    http://Wufoo.com
    Forms to Go
    http://www.bebosoft.com/products/formstogo/ove
    PHP Formmailer script from DB Masters can be configured to process all the forms on your domain.  It conceals your email address from prying eye email harvesters and it has several  spam controls built into its script including  hidden field (honeypot), "sorta  captcha,"  and time limits on submissions to keep robots from exploiting your  forms.  Free to use if you credit the author; $20 if you don't.
    http://dbmasters.net/index.php?id=4
    Q&A  Forum - http://dbmasters.net/forum.php?id=3&fid=9
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • VTP from server to client mode

    Hi,
    I have couple switches setup in VTP server mode. All of them have the same VTP revision number, but most of them should be in VTP client mode.
    Will switching some of them (but the one I really want to have in VTP server mode) into VTP client mode have negative impact on the network? I do know that if you change a switch (with the highest rev #) from client mode to server mode I could end up with problems. However, in my case it will be switching them from server to client mode with all of them with the same Rev #.
    Thanks for the help

    Hello,
    change the switches in question to VTP transparent mode first, and then to client mode, that will reset the revision and prevent any possible conflicts.
    In addition, in case you need to change the root switch as well, in general the VTP server switch should also be the root for your VLANs. You can set the switch as root by configuring it as:
    spanning-tree vlan x priority 0
    HTH,
    GP

  • JavaConsole Error: Problem reading data from server

    HI All
    We are getting this error on java console on a page:
      Error: Problem reading data from Server - Java.Security.AccessControlException:access denied (java.util.PropertyPermission http.strictpostredirect Read)
    In this page we are not firing  a SQL Query of huge data.
    Any suggestions on this why it is happening?
    Thanks
    Manisha

    Manisha,
    I think JVM(Java Virtual Machine) is trying to access something at network level and it cant able to find it.Or any new patches of java is installed.
    Or may be due to IIS or Applet,Don't know exactly.
    You can find some answers in below links:
    http://java.sun.com/j2se/1.4.2/docs/api/java/security/AccessControlException.html
    http://www.webdeveloper.com/forum/archive/index.php/t-46358.html
    -Suresh

  • Need to POST data from a desktop client to a server.

    Hello all, it's been awhile since I've posted here, so I hope everyone has been doing well.
    I have cross posted this here java - Need to POST data from a client application to my server - Stack Overflow but no answers, and since SO has been extremely slow for the questions I've been asking I am posting here.
    Here is the post:
    I know the title is probably a common question, but I am a bit confused on everything I'm trying to do, so I am trying to piece it together, and figured a common title would be better than a confusing one.
    I am basically developing a web application and one part of that is a file uploader. I am using Apache Commons File Upload via the Streaming API, and that all works fine, except I need to access the file I'm uploading, because that contains data to additional files to upload.  I.e., Read File A, get paths to images, upload images with File A to server and save on server.  The API can be found here http://commons.apache.org/proper/commons-fileupload/streaming.html
    I was told there is a security risk via the web and would be impossible via a browser, since the user needs to select all files to upload, i cannot tell the browser to upload additional files, so I am left with a client side option.
    I am confused if there is a special library I need, or as I have been seeing threads that talk about using the built in UrlConnection Class or http://hc.apache.org/
    I basically need to be able to read the file, which technically gives me a path to a Database on the user's system which I then read to get the additional images.  After I get all of that I then  need to post the data as a multipart form as that is what the FileUpload requires.
    form method="POST" enctype="multipart/form-data" action="fup.cgi">
      File to upload: <input type="file" name="upfile"><br/>
      Notes about the file: <input type="text" name="note"><br/>
      <br/>
      <input type="submit" value="Press"> to upload the file!
    </form>
    This is the example found in the Overview section of the Fileupload which can be accessed from the link above.
    There wouldn't be an issue if the users uploaded all of the data themselves, but since I have to do some of it automatically it causes some "concerns/issues."
    Basically these files are created and packaged from another application, so the images, and the db will always be in the same place, and that file that they are uploading is a file the other program creates, so everything will always be known, I just need to upload it, and then POST it as enctype="multipart/form-data" So that my servlet can read it and save it on my server.
    So I would appreciate it if anyone had any suggestions on where to begin my journey with this.  I have heard of a few applications like curl and wget that are used for this, but those seem to be more C based.  As mentioned earlier it seeems the httpcomponets from apache might work well, but I want to make sure.
    I appreciate all the help, thank you for your time all.

    It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
    [http://java.sun.com/docs/books/tutorial/essential/io/]
    *Unless you write a bunch of JNI code to replicate what the java.io classes are doing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to save file from server to client machine

    Hi,
    By using POI library i'm writing values to the existing excel sheet which is available in server. After i written values to the excel, i want to save the same file to the client machine.
    How to achieve this.
    I googled about this, but still i didn't get any clear idea.
    Thanks in advance,
    SAN

    Sameera,
    No, i can't understand what is the meaning of the following code:
    public void doDownload(FacesContext facesContext, OutputStream outputStream) {
    // write the neccessary code to get the download data from the Model
    String data = getDownloadData();
    // save to the output stream
    try {
    OutputStreamWriter writer = new OutputStreamWriter(outputStream,"UTF-8");
    writer.write(data);
    writer.close();
    outputStream.close();
    } catch (IOException e) {
    // handle I/O exceptions
    can you please explain this code little more.
    Edited by: san-717 on Feb 29, 2012 2:30 PM

Maybe you are looking for

  • How do I set the Pic to fit inside the game for requests?

    When I play farmville or cityville I can harvest or pick crops but can't make any requests too friends too help me with parts cause the menu comes up too big too hit send. So I'm unable too see or click on these requests.

  • Script + VoiceOver in Numbers

    I'm trying to create a dictionary for learning new English words. f.e. I have already some list of words in my Numbers document and I want "learn" pronounce of this words with VoiceOver or embed utility in Numbers. I know, that iWork doesn't have som

  • Urgent, related to discounts

    Hi Gurus I have a requirement. my client belongs to hytech industry. we have materials 10054 and 10099. he wants to give 10099 at 50% discount on base price, if customer orders 10054 along with it. on 1:1 basis i.e. in order if customer orders 10054 

  • Is there a solution to external HDD ejecting during backups?

    I've used Super Duper. I've used Time Machine. I've tried copying tons of files from one external HDD to another. Every time, the backup crashes and delivers the message that said HDD was not properly ejected. This did not happen with Tiger, but star

  • Adding a LOV by Extension to oracle.apps.icx.por.req.webui.ShoppingCartPG

    Hi, I have extended the the ShoppingCartVO to add additional attributes and can displayed these attributes via personalization. I tried adding a standard LOV by personlization withe external Lov = /oracle/apps/icx/lov/server/SupplierAndSiteLovVO. Thi