How could I create ObjectInputStream and use it indefinitely with Servlets?

Hi All,
I would like to create the stream object between applet and server only once with urlConnection.openConnection() and use it to write objects to it indefinitely without reinstantiating it or getting another connection with urlConnection.openConnection() and repeatedly query for another input / output stream with servletOutputStream = new ObjectOutputStream (servletLinkup.getOutputStream()); How could this be done?
Devyn

Dear vladimp,
The thing is, you need to ask good questions to receive good answers.Have you ever written a servlet vladimp? More specifically, have you ever written client - server code and have the two sides send objects to each other over the HTTP protocol?
This question is directed towards those developers who have done similar code and may have suggestions regarding this post.
What have you tried and how exactly has it failed for you?Quote from my post: "I would like to create the stream object between applet and server only once with urlConnection.openConnection() and use it to write objects to it indefinitely without reinstantiating it or getting another connection..." - that is, every time I want to write another object to the stream. Apparently whatever I tried didn't work, hence I'm posting here. Maybe someone with more servlet development experience would be willing to shed some light on this.
Why do you think the overhead of wrapping ObjectInput/OutputStreams
around the URL stream is large?Why do you believe I care if the overhead is large? My question is about maintaining a persistent connection to a servlet not overhead.
Have you made use of OutputObjectStream.reset()?This is actually a legitimate question (even though it's an ObjectOutputStream not a OutputObjectStream). The answer is YES I tried and NO it didnt' work. Could be that anything sent has to be followed up by a .flush() or/and a .close() to actually trigger the stream to send the object. At least according to some sources (I'm trying to verify this).
How about some sample code that reproduces the issue?URLConnection servletLinkup = urlConnection.openConnection();
servletOutputStream = new ObjectOutputStream (servletLinkup.getOutputStream());
Should be obvious for someone who did it before.
What is it about this problem that warrants a post to Advanced
Language Topics forum vs, say, Serialization forum?Testosterone driven guru java developers. Perhaps this could also go under the 'Java Servlet Technology' section as well, who knows, there's so many to choose from. I've actually gotten some very creative replies regarding this in other places. I can't say I didn't enjoy this post, however. 8^D. Thnx to all who have read the post.
Devyn

Similar Messages

  • How could i parse string and link its model with my files in eclipse project?

    How could i parse string and link its model with my files in eclipse project?, as i read that we dont have to use standalone mode while working with eclipse projects.
    Example of what i want to do:
    I have file1.dsl in my project which contains some statements but the declaration of these statements are not in another file, i need to put them only in my code

    Hi Stefan,
    I have eclipse project contains 2 files, file1.dsl and file2.dsl, you can see the contents of the files below.
    file1.dsl contains some statements as shown below and file2.dsl contains the declarations of the variables. (like in C++ or Java we have declarations and usage)
    At this step file1.dsl and file2.dsl will be parsed successfully without any errors.
    Lets imagine that we will delete this project and will create another one and the new project will contain only file1.dsl (which contains the usage)
    At this step this file (file1.dsl) will contains some errors after parsing it, because we are using variables without declarations.
    So what i need is to parse the content of file2.dsl directly without adding this file to the project.
    I need to add the content of file2.dsl directly as a string in the code and parse it. just like that ( "int a;int b;" )
    And link file1.dsl with the model generated after parsing my string
    file1.dsl
    a++;
    b++;
    file2.dsl
    int a;
    int b;
    Thanks

  • How could I create a "Linked Server" link from SQL Server 2008R2 64-Bit to Oracle Database 11.2 64-Bit?

    How could I create a "Linked Server" link from SQL Server 2008R2 64-Bit to Oracle Database 11.2 64-Bit?
    Let's say the SQL Server and Oracle Database are in the same Company Internet Network.
    I have the code, but I do not know how to use it. Such as what is System DSN Name? Where could I get it. What does it look like?
    Do I need to install any Oracle Client Software in order to link from SQL Server to Oracle? Or SQL Server has the built-in drivers installed already that I can directly create a Linked Server from SQL Server to Oracle?
    I need to know details. Thanks.
    USE master
    go
    EXEC sp_addlinkedserver
         @server  = '{Linked Server Name}'
        ,@srvproduct = '{System DSN Name}'
        ,@provider  = 'MSDASQL'
        ,@datasrc  = '{System DSN Name}'
    EXEC sp_addlinkedsrvlogin
         @rmtsrvname = '{Linked Server Name}'
        ,@useself  = 'False'
        ,@locallogin = NULL
        ,@rmtuser  = '{Oracle User Name}'
        ,@rmtpassword = '{Oracle User Password}'

    You need an OLE DB provider for Oracle. There is one that ships with Windows, but it only supports very old versions of Oracle. Oracle has an OLE DB provider that you can use. I don't know if it's part of Oracle Client or how it is bundled.
    You should not use MSDASQL or any DSN.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How could I create a Compliance Settings that enforces NetBIOS over TCP/IP?

    Hello Everyone,
    I need to be able to enforce NetBIOS over TCP/IP on some collections. I've created a batch script  with one line that disable NetBIOS over TCP/IP but I also need to make sure this is enforced. How could I do the enforcement using Compliance Settings?
    This is the line I use to disable it;
    "wmic nicconfig where (TcpipNetbiosOptions!=Null and TcpipNetbiosOptions!=2) call SetTcpipNetbios 2"
    Thank you everyone in advance for any help

    I could probably help you with a CI for discovery and remediation, but I need (or you need to define) an additional parameter.
    If I were to run this as a powershell discovery script:
    $adapter=(gwmi win32_networkadapterconfiguration | where {$_.ipenabled -eq "1"})
    Foreach ($nic in $adapter) {
    write-host $nic.TcpIPNetBiosOptions
    what's echo'd out (in my testing) is a 0, a 1 , or a 2.
    0 means "default--use what your dhcp is offering"
    1 = enabled
    2 = disabled.
    So... from your standpoint... is a 0 or 1, (either one) acceptable?  or is only a value of 1, a hard-coded at the client (not whatever the default is from dhcp) the only acceptable value?
    fyi, the remediation script, if 1 is the only acceptable answer, would probably be this:
    $adapter=(gwmi win32_networkadapterconfiguration | where {$_.ipenabled -eq "1"})
    Foreach ($nic in $adapter) {
    $adapter.settcpipnetbios(1)
    Standardize. Simplify. Automate.

  • How could you create 'Last Time Contacted' Smart Mailbox in Mail app Lion?

    Hello!
    For the purposes of maintaining regular contact with a large group of contacts in your address book:
    How could you create a smart mailbox in the Mail App (Lion) which contained that last unique sent/received email from each individual contact?
    So ideally just the last email per contact. For my purposes I would then sort by date and find the contacts I havent emailed in a while and re-initiate conversation.
    I also thought that perhaps it would be possible through Automator? (I am not very familiar with how to use this app)
    Any ideas/solutions would be very appreciated!
    nmarks
    (running lion 10.7.4 macbook pro late 2011)

    Okay, I think I just discoverd a workaround. This will work if you're lucky enough to already have a smart-mailbox folder that persists after close. (Somehow I had two such folders that already existed and weren't subject to the mysterious disappearances on closing the app; perhaps I created them in a previous OS X release?) Anyway, here goes:
    Locate an already existing smart mailbox folder that's working properly. Select the folder (in the sidebar).
    Duplicate that folder using the "Duplicate Smart Mailbox" Command. (It's on the contextual pop-up menu or available via the gear icon in the lower left of the window). This should produce and exact copy of the folder and the boxes inside, appearing at the bottom of the smart mailbox list.
    Edit the duplicate folder to put the smart mailboxes you want in it, and delete the previous mailboxes (duplicates) that you don't want.
    The new folder structure should now persist between launches of the app.
    There you go. Not the most elegant process, but workable. Don't know if there's a method if you don't have at least one smart mailbox folder already though.

  • How do you create an installer/bundle for PPro with extension, a plugin (export-controller) and some

    Hi
    As my topic says
    How do you create an installer/bundle for PPro with extension, a plugin (export-controller) and some custom presets?
    Assume you have Flash Builder 4.5, CS Extension builder 2.0, Xcode 4.5.1 running under MacOS 10.8.

    I understand why you need updated running headers in your book. To a sighted reader these serve as a guide to where you are and help you find things quickly.  In addition, if you are exporting your data to XML or HTML from the tagged PDF it would also be important to have these in the proper location. 
    But for accessibility purposes, it doesn't have to be there because the screen reader reads everything in linear order, line by line.  No one is looking at the page.  A user listening to the screen reader read the page is going to hear this heading, just before the actual word itself. So they will hear the first word on the page twice.  It's not the end of the world if it's there, but such headings are not necessary for accessibility unless they are not repetitive and contain information that is not otherwise available.
    So I would say, fine if you need them or want them there, it's just one word. 
    I think you should try exporting your book to PDF (or even just a chapter of the book) and look at the tags panel in Acrobat to see if you are getting the result you want.  I can't tell you exactly what you should do to get those results, you are using a plug-in I don't have. 
    I can tell you I didn't have to add the headers to any article at all, they just automatically export if the other articles in the file are added and you don't select the header style option "not for export as XML."
    You may not experience the same results with your plug-in, but I think it will probably work the same way. 
    Give it a try and best of luck.

  • How Do I create a Ringtone Using an mp3??

    Hi
    As the topic suggest. How do I create a ringtone using a mp3 instead of buying ringtones from iTunes?
    Thanks
    Baz

    madgroundhog wrote:
    I've tried this method, but it's still not working for me, for some reason. I've got the 3GS. I followed the instructions, and the created ringtone is showing up in iTunes in the Ringtone section. When I connect my iPhone to my Mac, & it appears as a device in iTunes, my ringtone appears there... it just doesn't appear under the ringtone options on the iPhone itself... what am I doing wrong here? Am I looking for it in the wrong place?
    Make sure to sync your ring tones.

  • When printing in Excel It is always want to use the acrobat X pro trial, which the trial is expired. I do not want to use acrobat X pro trial anymore. How can I reset it and use simple acrobat to print my PDF document?

    When printing in Excel It is always want to use the acrobat X pro trial, which the trial is expired. I do not want to use acrobat X pro trial anymore. How can I reset it and use simple acrobat to print my PDF document?

    Hi screen name,
    Adobe PDF printer gets installed when you install Acrobat 10 Pro.
    To use this printer you need to purchase Acrobat. Once the trial period is over you cannot use the printer to create pdf files.
    An alternative way for you is to utilize Microsoft's own inbuilt pdf engine.
    You can simply open the file and select 'Save as' and in the type list select 'pdf'
    Please refer : http://office.microsoft.com/en-in/excel-help/save-as-pdf-HA010354239.aspx
    Regards,
    Rave

  • How do we create a vendor using portal?

    how do we create a vendor using portal.
    creation process needs to trigger workflow.
    Sonali

    You need to use WLST online. I am not sure what your exact requirements are but one good way of working this is to have a WLST script that deletes all your WL customisations, like connection pools, JMS Servers etc and then creates it. That way you can run the same script repeatedly and it will get everything up to date for you. However you have to remember that everytime you add something new you need to update your delete section. Also your deleting should not fail if the item does not exist. I hope that makes sense!
    As to the specifics of WLST examples to do this then check out the WLST examples in CodeShare.
    If you are still having issues then post another message.
    Geoff

  • Recently I erased an iPhone 3 so that it could be passed on and used by someone else, using the erase all content and settings feature. This has killed my iPhone and it is now stuck on the Apple logo. I have tried a restore in iTunes but recovery fails.

    Recently I erased an iPhone 3 so that it could be passed on and used by someone else, using the erase all content and settings feature. This has killed my iPhone and it is now stuck on the Apple logo. I have tried a restore in iTunes but recovery fails. This is not a jailbroken iPhone. Anyone have any suggestions on how to proceed?

    If you haven't already tried, see if you can force it into recovery mode to restore it:
    http://support.apple.com/kb/ht1808.  If that doesn't work, the last thing you can try is to put it in DFU mode to restore it: https://discussions.apple.com/thread/2648467?threadID=2648467&tstart=0.

  • How can i create PR and if there is some change in the PR due to wrong calc

    Dear all,
    I wanted to know how can i create PR, and is that simple? Ok, while creating PR, when i will come to know that stock entered here is less that the actual stock that was mentioned, but due to some error, how can i change it, how is that possible?

    1981,
    You have posted this question in the wrong forum.  Such topics are covered in the MM forum
    SAP ERP - Logistics Materials Management (SAP MM)
    You can easily create a new PR in ECC using transaction ME51N
    You can easily change an existing PR in ECC using transaction ME52N.
    Best Regards,
    DB49

  • How could I create an BusinessObjects Auditor Database after installing the BOE?

    Dear Folks,
         As usual,I can create a BussinessObjects Auditor and CMS Database at the same time.
         But now, I have installed the BOE without Auditor Database.
         How could I create an BusinessObjects Auditor Database?

    Which version of  BO you have?
    if you are on BO 4.0 - Login to CMC- Select 'Auditing' and in the configuration, specify the Audit DB details. Once you enable Auditing, tables will be automatically created.
    3.1 - Stop SIA on the server. Right click on SIA, Properties- Configuaration- Specify Audit DB details. Restart the SIA

  • How do I create variables and store them?

    How do I create variables and store them?

    As someone already said, we need to know a little more about what you want to do with these variables, but in general, APEX Items are probably what you want. You can create APEX Items at the Application or Page level. Once you set the value of an item, you can reference it anywhere else in the application. So, if you have an item on page 1 called P1_ENAME, you can reference it on page 32 using bind variable syntax :P1_ENAME. If you just want to store but not display some information, you can use either a hidden page item or an Application Level item. Take a look at the 2 Day Developers Guide for more info.
    Tyler

  • I had an iPad2 and use a PC with windows xp to synchronize iTunes. Now i have a Mackbook Pro. How do I synchronize my Ipad to the new macbook without losing all my data?

    I had an iPad2 and use a PC with windows xp to synchronize iTunes. Now i have a Mackbook Pro. How do I synchronize my Ipad to the new macbook without losing all my data?

    On the MacBook launch iTunes.
    From the menu bar click Store / Authorize This Computer.
    Now sync your iPhone.
    Apple - Support - iPhone - Syncing

  • I have a windows computer. How can I create apps and put them on itunes?

    I have a windows computer. How can I create apps and put them on itunes?

    You can't. The iOS SDK requires Mac OS X and an Intel Mac; Windows applications can't be put on either the iOS or Mac OS X App Stores.
    (82889)

Maybe you are looking for