Grouping data sent to servlet

I have an applet servlet pair and I'm having trouble grouping the data coming in from various clients. Let's say there are five clients connected to the servlet on individual threads. The data from clients A, B, and C need to be grouped together, while the data from clients D and E are grouped together. In reality the exact groupings are determined at runtime by the users, but for out example let's say this is how it has worked out. My idea was to create for each group an instance of some class, let's call it simply "clientGroup" on the server that holds and processes the data for each client group. So data coming in from clients A, B or C would be placed into clientGroup1, while any data that came in from D and E would be placed in clientGroup2. To do this it seems that I need to send some sort of metadata with the actual data I'm sending from the applet to the servlet that instructs the servlet "put this data into clientGroup1" or whichever. Reflexivity seems only to be able to create new objects of class clientGroup, not reference and edit existing instances like clientGroup1 or clientGroup2. So what can I pass along with my data to instruct the servlet in which class instance to put the incoming data?

At least you should be able to identify clients to check to which group they belong. The client should for example be logged in and its group ID should already be known at the server side. Or let the client pass a specific parameter indicating the group ID. If you can do that, then it is just easy. Declare an applicationwide Map somewhere where you use the group ID as key and the group data as value.

Similar Messages

  • How to display data sent from a midlet to a servlet over an outputstream in

    a browser??
    Hello
    Currently I send data to a servlet from a midlet and the servlet recieves and processes the data (confirmed through breakpoints) but I want to display the data in a JSP or directly thru the servlet using html tags.
    However I can forward or redirect the data from the servlet to my jsp code but this still doesn't launch a browser.
    A little more detail... I am not sending information from a JSP to the servlet. The servlet is listening on a port for input, so the servlet is being invoked directly when the data comes in. In the current state my servlet sends the results in a session object to a JSP which gets the results but can't display them since it doesn't launch browser.
    Does anybody know how I can achieve what I am trying to do or maybe suggest a better way to do it?
    Thanks

    The value of a list box will either be a string (if none or one item is selected) or an array (if more than one item is selected). So your code has to determine which it is, and if an array (object), loop through it and get the text of each selected item and add the comma and space. If it's not an array, just use the returned value. Here's a simple custom Calculate script that you can use in the text field:
    // Custom Calculate script for text field
    (function () {
        // Initialize the string
        var s = "";
        // Get the value of the list box (string or array)
        var v = getField("your_listbox").value;
        // If more than one item is selected, the type of the value will be "object" (an array really)
        if (typeof v === "object") {
            // Loop through the array to build up a string
            for (var i = 0; i < v.length; i++) {
                if (s) s += ", ";  // Add a comma and a space if needed
                s += v[i];  // Add the selected value
            // Set this field value to the string
            event.value = s;
        } else {
            // Set this field value to the one item selected
            event.value = v;
    Replace "your_listbox" with the actual name of the listbox you're using.

  • Group MMS sent from my iPhone 4 - I did not send it

    I had a group MMS sent from my iPhone 4 this morning - they sent it to 3 of my contacts and 3 numbers I do not know.
    I was at work at the time the message was sent and it was zipped up in my purse.
    I have my own office and none of my co-workers had/has access to my iPhone to play a prank.
    It was a chain mail type thing, one was an image/picture.
    Could this be a random thing or should I be concerned that my phone/MMS messaging has been hacked?
    My phone is not jailbroken or anything like that - I've checked my data usage and it's low (only a few days into my billing cycle)
    It was sent about an hour ago and no more have gone out since - just not sure what to do.
    Thanks for any advice you can give!

    In addition to my iphone I have an itouch.  I only just today created an appleID so that I could use this message board so it seems unlikely that the problem is the result of a misused ID

  • How can i get an Applet transfer data to a servlet like a Form does?

    it is clear that URL class provides way to connect to remote web resource. and furthermore i am trying to make an applet perform like a Form in html to send user data to a servlet. i may adhere a long name-value string to url sent by applet but this is not a good way to hide information like hidden variables. Is there any class in J2SE package that i can wrap those Form data and send them in the way Form does...?
    cheers!

    Double posted
    http://forum.java.sun.com/thread.jspa?threadID=578770&messageID=2913924#2913924
    In your other post:
    but i just don't want to build a string with serlet name followed by many NV pairs tthis is a GET request:
    myURL?name=value&name=value
    To use a POST
    http://javaalmanac.com/egs/java.net/Post.html
    This still requires you to make a VP string that you write to an outputstream of the
    URLConnection. There is no other way to do this unless in an applet.

  • Sending data to a Servlet. EOFException and StreamCorruptedException.

    Hi!
    I have a small servlet that receives some text from a client, and returns a response. The problem is that when i try to receive the data in the servlet, I get and EOFException. And when the client tries to read the response, a StreamCorruptedException is thrown. Can anybody please point me in the right direction here?
    The code for servlet is as follows:
         protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              DataInputStream in = new DataInputStream((InputStream) request.getInputStream());
              String message;
              String text = null;
              try {
                   text = in.readUTF();//EOFException thrown here!
                   message = "100 ok";
              } catch (Throwable t) {
                   message = "200 " + t.toString();
              response.setContentType("text/html;charset=UTF-8");
              response.setContentLength(message.length());
              in.close();
              PrintWriter out = response.getWriter();
              out.println(message);
              out.flush();
              out.close();
              System.out.println(". Received text: " + text == null ? "none" : text);
         }And the code for the client:
         @Test
         public void test2() throws IOException, ClassNotFoundException {
              String input = "This text is to be sent";
              URL serverURL = new URL("http://localhost:8080/myURL");
              URLConnection con = serverURL.openConnection();
              con.setDoInput(true);
              con.setDoOutput(true);
              con.setUseCaches(false);          
              con.setRequestProperty("Content-Type", "application/x-java-serialized-object");
              OutputStream outstream = con.getOutputStream();
              ObjectOutputStream oos = new ObjectOutputStream(outstream);
              oos.writeObject(input);
              oos.flush();
              oos.close();
              InputStream instr = con.getInputStream();
              ObjectInputStream inputFromServlet = new ObjectInputStream(instr);//StreamCorruptedException thrown here ("invalid stream header")
              String result = (String) inputFromServlet.readObject();
              inputFromServlet.close();
              instr.close();
              System.out.println(result);
         }The EOFException is thrown at the line text = in.readUTF(); in the servlet, and the StreamCorruptedException is thrown at ObjectInputStream inputFromServlet = new ObjectInputStream(instr); in the client. What is wrong here?
    Edited by: Fush on Apr 15, 2008 6:59 AM
    Edited by: Fush on Apr 15, 2008 7:00 AM
    Edited by: Fush on Apr 15, 2008 7:03 AM

    Your server reads a UTF-encoded String with readUTF().
    So your client should write a UTF-encoded String with writeUTF().
    Your server writes lines with PrintWriter.println().
    So your client should read lines with BufferedReader.readLine().

  • Amount of data sent is unexplainable

    I am using an iphone 4 and the amount of data sent by the phone in the background is unexplainable and it costs me alot. It happens even if I am not browsing on the internet or downloading anything. I there a way to restrict this? What data is sent in the background?

    Have you tried double-clicking the home button and closing all the apps that use an Internet connection? Also, your preferences for Mail might have it checking and downloading automatically.
    I once started a live CNN video feed on Wi-fi, then pressed the home button, put my phone to sleep and went somewhere. That night, I'd used 480 MB in one day - it was still streaming it in the background!

  • [Forum FAQ] How do I export each group data to separated Excel files in Reporting Services?

    Introduction
    There is a scenario that a report grouped by one field for some reasons, then the users want to export each group data to separated Excel files. By default, we can directly export only one file at a time on report server. Is there a way that we can split
    the report based on the group, then export each report to Excel file?
    Solution
    To achieve this requirement, we can add a parameter with the group values to filter the report based on the group, then create a data-driven subscription for the report which get File name and parameter from the group values.
    In the report, create a parameter named Name which use the Name field as Available Values (supposing the group grouped on Name field).
    Add a filter as below in the corresponding tablix:
    Expression: [Name]
    Operator: =
    Value: [@Name]
    Deploy the report. Then create a data-driven subscription with Windows File Share delivery extension for the report in Report Manager.
    During the data-driven subscription, in the step 3, specify a query that returns the Name field with the values as the group in the report.
    In the step 4 (Specify delivery extension settings for Report Server FileShare), below “File name”option, select “Get the value from the database”, then select Name field.
    Below ‘Render Format’ option, select Excel as the static value.
    In the step 5, we can configure parameter Name “Get the value from the database”, then select Name field. 
    Then specify the subscription execute only one time.
    References:
    Create a Data-Driven Subscription
    Windows File Share Delivery in Reporting Services
    Applies to
    Reporting Services 2005
    Reporting Services 2008
    Reporting Services 2008 R2
    Reporting Services 2012
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thanks,
    Is this a supported scenario, or does it use unsupported features?
    For example, can we call exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='b64ce7ec-d598-45cd-bbc2-ea202e0c129d'
    in a supported way?
    Thanks! Josh

  • Start to finish, grouped data to xmlp

    Can anyone outline for me the best process by which I would query multi-level grouped data, generating subtotals in the database, and then pass that data to the XML publisher report, with the notion of grouping and subtotals communicated to the report? I don't want to perform the grouping in the report, as it involves large numbers of records. I can find in various places how to generate XML from the database using SQLX, but I don't understand how to get that XML to be used in a report as a datasource. I can paste it in as a query in the MS Word Template builder, but don't know how to get it into the XMLP Enterprise side of things.
    So, given this example query, could someone tell me how to get the data and the meaning of the data into XMLP?
    select emp.deptno,emp.mgr,emp.empno, sum(emp.sal)
    from emp inner join dept
    on (emp.deptno=dept.deptno)
    group by
    rollup(emp.deptno,emp.mgr,emp.empno)

    Oh, yes, I've tried...but I'm at a loss as to how to put the various pieces of XML Publisher together with a data template in the mix. Can anyone give an example of how one would actually go from my example query through data template and .rtf template to final report in XML Publisher Enterprise?

  • Attachments in a group email sent from outlook 2007 do not show in the message

    iPad doesn't show attachments in a group email sent from a Windows 7 PC using outlook 2007. Doesn't matter what the attachment is, if it is sent to a group created in Outlook the attachments do not come through. Is this a bug in iOS? My Google Nexus 4 phone handles the attachments just fine.

    ''Toad-Hall [[#answer-670403|said]]''
    <blockquote>
    Is the 'in the clear' bar code number part of an image, it may be not shown because it was remote content?
    What happens if you read the email using 'PlainText view' ?
    'View' > 'Message body as' > 'Plain text'
    Do you have anti-virus software scanning emails?
    If yes, then switch it off to see if it is effecting the emails when it downloads.
    </blockquote>
    Thank you very much Toad-Hall. That is the information I needed. Perfect!

  • How to determine amount of data sent/received by partner

    Here is our situation.  We have PI 7.0 running.  Now we want to charge back to our internal users based on the amount of data sent or received.  Does anyone know where or if the size of the messages are stored; we would like to get the data by receiver. 
    This seems like a simple thing, but I have not been able to find anything on this topic.
    Thanks,
    Rich

    Rich,
    in RWB => Performance monitoring you can filter per interface / receiver / sender / etc.
    All information is available there (size, timestamp, runtime, ...)
    Also you can easily exort data too.
    Check it.
    Regards,
    Kai
    Edited by: Kai Lerch-Baier on Mar 20, 2009 3:14 PM

  • Insufficient data sent error in Adobe Reader XI and Adobe Reader X

    I have an issue that is happening with several users that I support.  It is only happening in a specific program that they use.  When they open PDFs, they get the message insufficient data sent and then a blank document opens.  I noticed that this seemed to be an issue a couple years ago, but it was apparently solved with recent releases of Adobe reader. I have installed and set up Adobe Reader XI and Adobe Reader X, but the results are the same and very intermittent.  It can happen when trying to open a document and then not happen 10 seconds later on the same doc.  The company that provides the online program blames Adobe.  Where do I proceeed from here?

    Hello,
    unfortunately it's a reserved document. I'll try to reproduce the issue with a different design and, if possible, I'll post a link to it.
    Thank you!
    Best regards,
    SV

  • How to group data from two tables ?

    Hello,
    I have two tables and i want to group data from them but two table not linked.
    Table TEXT_IN : ID_IN (primary_key), DATE_IN
    Table TEXT_OUT : ID_OUT(primary_key),DATE_OUT
    Example :
    Result :Group Date and Order by IN,OUT
    And It seems a bit
    confusing because we do not link
    .You can give me solutions.
    Thank you.

    SELECT MAX(CASE WHEN Rn = 1 THEN [IN] END) AS [IN1],
    MAX(CASE WHEN Rn = 1 THEN [OUT] END) AS [OUT1],
    MAX(CASE WHEN Rn = 2 THEN [IN] END) AS [IN2],
    MAX(CASE WHEN Rn = 2 THEN [OUT] END) AS [OUT2],
    MAX(CASE WHEN Rn = 3 THEN [IN] END) AS [IN3],
    MAX(CASE WHEN Rn = 3 THEN [OUT] END) AS [OUT3],
    MAX(CASE WHEN Rn = 4 THEN [IN] END) AS [IN4],
    MAX(CASE WHEN Rn = 4 THEN [OUT] END) AS [OUT4],
    MAX(CASE WHEN Rn = 5 THEN [IN] END) AS [IN5],
    MAX(CASE WHEN Rn = 5 THEN [OUT] END) AS [OUT5],
    FROM
    SELECT COALESCE(m.DATE_IN,n.DATE_IN) AS DATE_IN,
    COALESCE(m.Seq,n.Seq) AS Seq,
    ID_IN AS [IN],
    ID_OUT AS [OUT],
    ROW_NUMBER() OVER (PARTITION BY Seq ORDER BY COALESCE(m.DATE_IN,n.DATE_IN)) AS Rn
    FROM
    SELECT ROW_NUMBER() OVER (PARTITION BY DATE_IN ORDER BY DATE_IN) AS Seq,*
    FROM TEXT_IN
    )m
    FULL OUTER JOIN
    SELECT ROW_NUMBER() OVER (PARTITION BY DATE_IN ORDER BY DATE_IN) AS Seq,*
    FROM TEXT_OUT
    )n
    ON n.Seq = m.Seq
    AND n.DATE_IN = m.DATE_IN
    )t
    GROUP BY Seq
    to make it dynamic see
    http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/dynamic-crosstab-with-multiple-pivot-columns.aspx
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Error :Unable to retrieve data from iHTML servlet for Request2 request

    I open bqyfile to use HTML in workspace.
    When I export report to excel in IR report.
    Then I press "back" button I get error"Unable to retrieve data from iHTML servlet for Request2 request "
    And I can not open any bqyfiles in workspace.
    Anybody gat the same question? Thanks~

    Hi,
    This link will be helpful, the changes is made in the TCP/IP parameter in the registry editor of Windwos machine. I tried the 32 bit setting for my 64 bit machine (DWORD..) and it worked fine for me..
    http://timtows-hyperion-blog.blogspot.com/2007/12/essbase-api-error-fix-geeky.html
    Hope this helps..

  • How to add a button to the grouped data in an AdvancedDataGrid?

    Hi,
    Can anyone please suggest how to add a button to the grouped data in the AdvancedDataGrid?
    I have tried extending the AdvancedDataGridGroupItemRenderer and using it as the groupItemRenderer but its not reflecting.
    For the leaf node the itemRenderer property works just fine.
    Please help!

    HI ,
    I want to add a push button on the ALV list out put which is comming as a pop up and I want this using classes and methods.
    I have got a method IF_SREL_BROWSER_COMMANDS~ADD_BUTTONS from class cl_gos_attachment_list  but still I am unable to get any additional button on the output ALV popup.
    Please help.
    Regards,
    Kavya.

  • New Photos App take a very long time to upload 20 Pictures, while the Activity Monitor is showing much more data sent (MB) than these two pictues

    The New photos app is taking a very long time to upload images. It stays a very long time at 20,104 for example. When I check the Activity Monitor (Network) it shows that the computer is actually uploading stuff. After about 2 hours, only 20 Pics&Videos are uploaded. The uploaded pics and videos are about 500MB while the data sent is around 1GB. I am positive that Photos is the only thing uploading data at the moment.
    Anyone else facing this problem?

    It can take days, even weeks.
    Tell me 2 things and I will tell you the estimated upload time.
    1 How big is your Library (in GB)
    2 How fast is your upload speed.
    Or you can just use the upload time calculator and do it yourself

Maybe you are looking for

  • Find table for table maintenance

    Say you’re in transaction mm03 to display a material.  How do you find the table you can perform table maintenance on to edit selections for field MVGR5?

  • UDF of request template of create user

    Hi I have created a user defined field in the user management. How can i make this field visible in the request template of create user.

  • Being a a valued customer at Verizon?

    Verizon does not value their customer...it's time for some change!   Paid from Feb. 2006 (customer since 2001 but did not go back this far) to Feb. 2015, a total of $17381.45.  Never called me or emailed me of any type of promotion, the phone upgrade

  • Multiple DAQ devices with AI scan clk loop control

    I have an application running under RT on a PXI controller that acquires AI data from a 6052E board. The time critical loop uses an external digital trigger for the scan clock. AI Single scan controls loop timing since it puts the thread to sleep unt

  • My 4s SIM card slot is jammed- won't open completely

    My SIM card seems to have slipped inside the slot and I can't get the 'drawer ' open now. It is a perfect phone which is useless until I can fix this. I took it to the apple store and they told me that they couldn't reach the sim with the back off, a