Sending a linked list from an applet to a servlet

Does anyone know how I can go about creating a file in an applet and then writing it to my server? The applet collects lots of useful data and I want to store it on my server (Apache 1.3.26 running on Windows XP) for use at a later date. To complicate things further, the applet stores all the data as a linkedList of double[][]'s.
I believe I may need to make a servlet to run serverside, but how do i send the linkedList to the servlet to create the file?
Anyone know how I'd go about doing this?
Cheers,
Dan

1 Use java.net.URL to connect to your server side servlet
2 Obtain the OutputStream of the URL by calling URL.openConnection().getOutputStream()
3 Wrap the OutputStram in step 2 with java.io.ObjectOutputStream
4 Write the data array in the applet to the ObjectOutputStream
5. In the servlet, read the data array using ObjectInputStream on the servlet request's input stream

Similar Messages

  • Errors executing bulk query when updating a Sharepoint Linked List from Access

    Hi all,
    I have a Sharepoint list that is a Linked List with MS Access. It has just under 5,000 items (4,864), thus meaning it avoids the reduction in functionality lists of greater than 5,000 items have.
    Among the list are five calculated columns. These take the information from another column (different employee numbers), and by using a formula produce a clickable link to my company's Directory page, where that particular employee's info is displayed. I'm
    not sure if these five columns are relevant to my query, but I'm mentioning them in case.
    My problem is this: Frequently when I run any query on the list that updates the list, I get this error: "There were errors executing the bulk query or sending the data to the server. Reconnect the tables to resolve the
    conflicts or discard the pending changes".
    When I review the errors, it says they conflict with errors a previous user made (with that previous user being me). It frequently highlights several columns, despite the info in them being identical, and the calculated columns (with the original showing
    the value they contained and the new showing #VALUE! (as Access can't display the formulas).
    However, if I click Retry All Changes, all the update stick and everything seems fine. Why is this happening? It's proving very annoying and is really stopping the automation of my large number of queries. A list of 5000 items isn't particular big (and they've
    got roughly 100 columns, although I didn't think that was too large either, given Excel's 200+ column limit).
    Is this due to poor query design and SQL? Is this due to connectivity issues (which I doubt, as my line seems perfect)? Is this due to Access tripping over itself and not executing the update on each row in the table, but rather executing them concurrently
    and locking itself up? I'm at wit's end about it and really need to get this sorted.
    Thanks in advance for any suggestions.

    Hi amartin903,
    According to your description, my understanding is that you got an error when you used a linked list from Access.
    The table that you are updating is a linked table that does not have a primary key or a unique index. Or, the query or the form is based on a linked table that does not have a primary key or a unique index. Please add the primary key or a unique index.
    Here is a similar post, please take a look at:
    http://social.technet.microsoft.com/Forums/en-US/545601e9-a703-4a02-8ed9-199f1ce9dac8/updating-sharepoint-list-from-access?forum=sharepointdevelopmentlegacy
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Is there a way to create a "Horizontal Links List" from a query?

    Hi,
    Is there a way to create a "Horizontal Links List" from a query?
    I want to display file names that I have uploaded as links to a display page.
    I don't know how to create my own template yet as I've read... I saw Jes had posted this idea...
    Thanks, Bill

    Yes, that is great Chris!
    Thanks for the site....
    Once I dynamically create the HTML for the list how do I feed it into the page?
    as an item? Can I access an HTML region body dynamically?
    Thanks, Bill

  • Constructing a linked list from an array of integers

    How do I create a linked list from an array of 28 integers in a constructor? The array of integers can be of any value that we desire. However we must use that array to test and debug methods such as getFirst(), getLast(), etc...
    I also have a method int getPosition(int position) where its suppose to return an element at the specified position. However, I get an error that says cannot find symbol: variable data or method next()
    public int getPosition(int position){
         LinkedListIterator iter=new LinkedListIterator();
         Node previous=null;
         Node current=first;
         if(position==0)
         return current.data;
         while(iter.hasMore()){
         iter.next();
         if(position==1)
         return iter.data;
         iter.next();
         if(position==2)
         return iter.data;
         iter.next();
         if(position==3)
         return iter.data;
         iter.next();
         if(position==4)
         return iter.data;
         iter.next();
         if(position==5)
         return iter.data;
         iter.next();
         if(position==6)
         return iter.data;
         iter.next();
         if(position==7)
         return iter.data;
         iter.next();
         if(position==8)
         return iter.data;
         iter.next();
         if(position==9)
         return iter.data;
         iter.next();
         if(position==10)
         return iter.data;
         iter.next();
         if(position==11)
         return iter.data;
         iter.next();
         if(position==12)
         return iter.data;
         iter.next();
         if(position==13)
         return iter.data;
         iter.next();
         if(position==14)
         return iter.data;
         iter.next();
         if(position==15)
         return iter.data;
         iter.next();
         if(position==16)
         return iter.data;
         iter.next();
         if(position==17)
         return iter.data;
         iter.next();
         if(position==18)
         return iter.data;
         iter.next();
         if(position==19)
         return iter.data;
         iter.next();
         if(position==20)
         return iter.data;
         iter.next();
         if(position==21)
         return iter.data;
         iter.next();
         if(position==22)
         return iter.data;
         iter.next();
         if(position==23)
         return iter.data;
         iter.next();
         if(position==24)
         return iter.data;
         iter.next();
         if(position==25)
         return iter.data;
         iter.next();
         if(position==26)
         return iter.data;
         iter.next();
         if(position==27)
         return iter.data;
         iter.next();
         if(position==28)
         return iter.data;
         if(position>28 || position<0)
         throw new NoSuchElementException();
         }

    How do I create a linked list from an array of 28 integers
    in a constructor? In a LinkedList constructor? If you check the LinkedList class (google 'java LinkedList'), there is no constructor that accepts an integer array.
    In a constructor of your own class? Use a for loop to step through your array and use the LinkedList add() method to add the elements of your array to your LinkedList.
    I get an error that
    says cannot find symbol: variable data or method
    next()If you look at the LinkedListIterator class (google, wait for it...."java LinkedListIterator"), you will see there is no next() method. Instead, you typically do the following to get an iterator:
    LinkedList myLL = new LinkedList();
    Iterator iter = myLL.iterator();
    The Iterator class has a next() method.

  • How do i send a contact list from address book to another person via email?

    how do i send a contact list from address book to another person via email?

    And your destination user uses a mac?
    Click on the group name.
    Go to the menu File > Export VCard . . .
    Save that file and send it.
    The recipient should  go to File > Import to import your list.
    MtD

  • High performance writing Chinese from an Applet to a Servlet

    Hi,
    I am using DataOutput/InputStreams to wrtie UTF (Chinese Characters from an Applet to a servlet) Now, I already HAVE the chinese characters in the applets memory and I need to write them to the servlet. I am using the "writeUTF()" and "readUTF" methods in the Input and output Streams. Now I want to replace the Data Streams with buffered Streams to improve performance. What is the equivalent method for buffereed Streams?
    DataOutputStream output = new DataOutputStream(connection.getOutputStream());
    output.writeUTF(chineseString);
    output.close();
    DataInputStream input = new DataInputStream(connection.getInputStream());
    String response = input.readUTF();
    input.close();
    Thanks.
    Regards,
    Carlos

    Hi Carlos,
    I don't think there is a method for buffered streams that is exactly equivalent to writeUTF, but you could use the character stream reader/writer pair as follows:
    OutputStreamWriter osw = new  OutputStreamWriter(connection.getOutputStream (), "UTF8");
    Writer output = new BufferedWriter(osw);     
    InputStreamReader  isr = new InputStreamReader(connection.getInputStream (), "UTF8");
    Reader input = new BufferedReader(isr);     now, however, since these classes don't have a read/write String method you will need to write out your string character by character followed by an end of Line:
    loop through characters in output String:
         output.write(aChar)
    output.newline ()and then read it back in as a line using:
    input.readLine() Post back if it's unclear.
    Regards,
    Joe

  • Is there a way to send the contact list from my flip phone to the Verizon Messages app on my tablet?

    I have a Convoy flip phone. I recently installed the Verizon Messages app on my iPad Air, since it's a pain in the neck to type texts on the phone. With the app on my tablet, I can easily send (and receive) texts. But is there a way to sync or send the contact list (phone book) from my flip phone to the Verizon Messages app on my tablet? Thanks.

    Hi daniel1948,
    Thanks for using our forums! While there are ways to get contacts from your phone onto your tablet, the Convoy series of phones is not capable of syncing directly with the Verizon Messages service. It is capable of using the Backup Assistant service. You'll find this option under Contacts in the menu. Once you have backed up the contacts, you can use your online My Verizon account to export contacts to either a Google or iCloud account, which would allow you to access them from your iPad at a later time via sync. Here's a link with some useful information on how to use the Backup Assistant service.
    http://vz.to/1GWVASh
    EricW_VZW
    Follow us on TWITTER @VZWSupport
    If my response answered your question please click the _Correct Answer_ button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!

  • User to call the name on a linked list from the console

    Hello,
    My program has 9 linked lists and I need to manipulate them depending on which one the user wants to add or remove from. The problem is it's different every time. I need a way to allow the user to input the name of one of the linked lists, and then from there I can manipulate that list. My general idea is as follows though the syntax is wrong.
    inputFrom = in.nextLine();
    inputFrom = inputFrom.toUpperCase();
    if (inputFrom.peek() != null){
    System.out.println("This list has data);
    {code}
    My problem is that in that if statement I can not simply place the variable in front of the action I wish to perform and expext the variable to substitute for the actual list's name. How can I work around this? Thank you in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Create a Map<String, List>, where String is the name of the list. Then you can do map.get("listName");

  • Sending an image from an applet to  a servlet

    I have sucessfully set up a Serializable connection between my applet and my servlet. However if i try to pass an object that implements the serializable interface that has a BufferedImage object encapsulated in it... a NotSerializableException is thrown... The reason i am doing this is that i have to save the image to disk (Server Side).. If someone could advise me on a way to solve this problem or provide a better solution to my problem i would grateful

    Implementing Serializable isn't enough to make a class serializable: every not-transient field must implement Serializable too.
    Said this, you can marshal an array of int (arrays are serializable of course!) containing your pixels:
    //Applet side
    BufferedImage img;
    Raster r=img.getRaster();
    int[] pixels=r.getPixels(0,0,r.getWidth(),r.getHeight());
    //serialize pixels, possibly along with width, height and imageType of BufferedImage
    //Servlet side
    int[] pixels;
    //deserialize pixels and possibly width,height and imageType
    BufferedImage img=new BufferedImage(width,height,imageType);
    img.getRaster().setPixels(0,0,width,height);Hope it helps

  • How do i make http connection  from an applet to  a servlet

    i am not able to make a http connection from the applet to servlet
    my code for servlet is as follows
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class newDatabaseServlet extends HttpServlet {
    //      Connection con;
    // Statement stmt;
         public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
              resp.setContentType("text/content");
              System.out.println("megha");
              String mthd[] = req.getParameterValues("event");
              System.out.println(mthd.length);
              System.out.println(mthd);
              System.out.println(req.getQueryString());
              // System.out.println("megha");
    PrintWriter fw = new PrintWriter(new FileOutputStream(new File("e:/JRun/servers/default/default-app/mycontent.txt")));
    String s = "this text comes from servlet";
    fw.print(s);
    fw.flush();
              if(mthd[0].equalsIgnoreCase("callEditor")) {
                   openEditor(req,resp);
    public void openEditor(HttpServletRequest req, HttpServletResponse resp) {
         /* try {
              Class.forName("oracle.jdbc.driver.OracleDriver");
         con = DriverManager.getConnection("jdbc:oracle:thin:@pc6:1521:oradba","test","test");
         catch(Exception e) {
              e.printStackTrace();
              try {
                   resp.sendRedirect("/RunApp1.html");
              catch(IOException e) {
                   e.printStackTrace();
    /*try {
         Class.forName("oracle.jdbc.driver.OracleDriver");
    con = DriverManager.getConnection("jdbc:oracle:thin:@pc6:1521:oradba","test","test");
         catch(Exception e) {
         e.printStackTrace();
         resp.setContentType("text/html");
         PrintWriter output = resp.getWriter();
         try {
    stmt = con.createStatement();
    String strContent = "select * from edTable where newsid = 2";
    ResultSet rs = stmt.executeQuery(strContent);
    if(rs.next()) {
                   String newsText = rs.getString(2);
    /* StringBuffer buf = new StringBuffer();
                   buf.append("<B>servlet</B>");
                   try {
                   resp.sendRedirect("RunApp");
              catch(IOException e) {
                   e.printStackTrace();
    //               output.println(buf.toString());
    //          output.close();
    my code for applet is
    import javax.swing.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import java.awt.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    public class EdApplet extends JApplet {
    public void init() {
         Container c;
         c = getContentPane();
    JPanel but = new JPanel();
    c.add(but,BorderLayout.NORTH);
    final JEditorPane je = new JEditorPane();
    JScrollPane jsp = new JScrollPane(je);
    HTMLEditorKit ht = new HTMLEditorKit();
    je.setEditorKit(ht);
    je.setEditable(true);
    HTMLDocument mdoc = (HTMLDocument)ht.createDefaultDocument();
    StyleSheet mcontext =mdoc.getStyleSheet();
    je.setDocument(mdoc);
    c.add(jsp,BorderLayout.CENTER);
    JPanel bot = new JPanel();
    c.add(bot,BorderLayout.SOUTH);
    JButton save = new JButton("save");
    but.add(save);
    String str = getInitialText();
         je.setText(str);
         String servletUrl="http://pc7:8100/servlet/newDatabaseServlet";
    try{
                   URL servletURL = new URL(servletUrl);
                   URLConnection servletConnection = servletURL.openConnection();
              servletConnection.setRequestProperty("event","saveText");
              servletConnection.setDoOutput(true);
              servletConnection.setUseCaches(false);
         catch(Exception e) {
    //          je.setText(e.printStackTrace());
         ActionListener lst = new ActionListener() {
              public void actionPerformed(ActionEvent ae) {
                   String save = je.getText();
                   saveText(save,je);
         save.addActionListener(lst);
    //je.setText("<B>this</B>");
    //URLConnection servletConnection = null;
    /* try {
              String servletUrl="http://pc7:8100/servlet/newDatabaseServlet";
              URL myUrl = new URL(servletUrl);
              servletConnection = myUrl.openConnection();
              servletConnection.setDoOutput(true);
              servletConnection.setUseCaches(false);
         /*     BufferedReader br = new BufferedReader(new InputStreamReader(servletConnection.getInputStream()));
    String t = br.readLine();
    je.setText(t);
         catch(Exception e) {
              e.printStackTrace();
    /* ActionListener lst = new ActionListener() {
              public void actionPerformed(ActionEvent ae) {
                   BufferedReader br = new BufferedReader(new InputStreamReader(servletConnection.getInputStream()));
                   String t = br.readLine();
    je.setText(t);
    click.addActionListener(lst);
    /*void String changeText(UrlConnection con) {
    BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream));
    String t = br.readLine();
    return t;
    public String getInitialText()
         //String me = null;
         URLConnection textConnection = null;
         StringBuffer sb = new StringBuffer();
         try {
                   String textUrl="http://pc7:8100/mycontent.txt";
                   URL myUrl = new URL(textUrl);
                   textConnection = myUrl.openConnection();
                   textConnection.setDoInput(true);
                   textConnection.setUseCaches(false);
                   BufferedReader br = new BufferedReader(new InputStreamReader(textConnection.getInputStream()));
                   // me = (String)servletConnection.getContent();
                   String s = null;
                   while((s = br.readLine())!=null) {
                        sb.append(s);
              catch(Exception e) {
                             e.printStackTrace();
                   return sb.toString();
         public void saveText(String saveStr,JEditorPane je) {
              //String saveStr = je.getText();
              //String servletUrl="http://pc7:8100/servlet/newDatabaseServlet?event='saveText'&newsid='2'";
              //String servletGet="http://pc7:8100/servlet/newDatabaseServlet";
              String servletUrl="http://pc7:8100/servlet/newDatabaseServlet";
              //String servletUrl = servletGet + "?"
              //     + URLEncoder.encode("event") + "="
         // + URLEncoder.encode("saveText");
    //     je.setText(servletUrl);
              try {
              URL servletURL = new URL(servletUrl);
              URLConnection servletConnection = servletURL.openConnection();
         //     servletConnection.setRequestProperty("event","saveText");
         servletConnection.setRequestProperty(
         "User-Agent","Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
              //System.out.println("from applet");
              servletConnection.setDoOutput(true);
              servletConnection.setUseCaches(false);
              //Propertiew prop = new Properties();
         //     prop.put("event","saveText");
              PrintStream out = new PrintStream(servletConnection.getOutputStream());
    out.println("event");
    out.close();
         catch(IOException e) {
              je.setText(e.toString());
    kindly tell me what is the error
    what is the best method of doing this
    thanking u in anticipation
    megha sood

    omg O_o
    We cannot debug your code, but:
    Did you try the servlet directly from your browser? Does it work?
    Best regards from Germany,
    r.v.

  • How can I send someone a 'list' from my address book?

    I see that you can't from one of the previous answers. So I tried to 'export' the 'list'. I don't see how you can do that. If I highlite the list, it exports the entire address book (1600+0 items and I can't edit that down to my 40 member list. So what else can I do?

    Try this add-on: https://nic-nac-project.org/~kaosmos/morecols-en.html
    According to its author's webpage:
    ''- gives the possibility to import and export a single contact or a list;''
    And this very evening I have used it myself to export an address book whilst investigating a query about sending to multiple addresses. The add-on let me export a Mailing List so I could create a file containing a list of valid email addresses.

  • How To Send Multiple Spool Lists  from a Single Step in SM37

    We have converted all of our output reports to ALV and now instead of one big spool that contains all the reports generated in a single step we now have multiple spools.  We run the program as a Batch Job in SM37 and have created an entry in the SPOOL LIST RECIPIENT for the job.  The problem is that it only sends one of our lists.  Is there a way to make it send all of the ists?

    You need to write areport program with fm 'RSPO_RETURN_ABAP_SPOOLJOB'  and collect all spools and send it and make this as precedent job after your ALV spool jobs

  • Is it possible send a SELECT APDU from one applet to another?

    Hello i want to select one applet from another. is it possible and how?. Thanks

    OK, I went to use this today, and can't figure it out.  Where do I place this code; In the SQL of a query, In the VBA of a form, or In a Modual?
    UPDATE Registrations RIGHT JOIN Registrations2
    ON Registrations.TEXT_REGISTRANT_ID = Registrations2.TEXT_REGISTRANT_ID
    SET Registrations.TEXT_REGISTRANT_ID = Registrations2.TEXT_REGISTRANT_ID,
    Registrations.[Name] = Registrations2.[Name]

  • Using Collections.binarySearch on a Linked list

    hi all
    i want to use the Collections.binarySearch method on a linked list object to add items to it. These items are of type Entry (a class i have created).
    i have the following code:
    public void addEntry(Entry newEntry)
            int pos = Collections.binarySearch(entryList, newEntry);
            if (pos < 0)
                entryList.add(-(pos) -1, newEntry);
    [\CODE]
    where entryList is declared as:
    private List entryList = new LinkedList();
    This code compiles OK, but when i run it to add an Entry element to the linked list, i get a ClassCastException being thrown, and im not sure why.
    i can add one Entry object to the list ok, but it falls over when i try to add another. im trying to order my Entry objects by a field called 'surname', so the binarySearch finds the correct location in the list for the new entry and then it is added.
    any help on this would be appreciated
    cheers
    david                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    binarySearch doesn't work on a linked listSo untrue:Well, only mostly untrue. It still doesn't really do a binary search on your linked list
    From the javadoc
    'This method runs in log(n) time for a "random access" list (which provides near-constant-time positional access). If the specified list does not implement the RandomAccess and is large, this method will do an iterator-based binary search that performs O(n) link traversals and O(log n) element comparisons. '
    import java.util.*;
    public class Test {
    public static void main(String[] args) {
    List entryList = new LinkedList();
    entryList.add(new Integer(3));
    entryList.add(new Integer(5));
    entryList.add(new Integer(1));
    Collections.sort(entryList);
    System.out.println(Collections.binarySearch(entryList,
    new Integer(5)));
    }Compiles and runs without any problems

  • I am unable using the properties inline to bring my link list to a horizontal look?

    I cannot in dreamweaver site set up bring my link list from a vertical to a horizontal using the properties inline?

    And that is supposed to mean what? If you refer to an alignment option for CSS, then you ahve a severe misunderstanding of what "inline" means. No, it doesn't mean "in a line". Time to read up...
    Mylenium

Maybe you are looking for

  • How to change Apple Id for the cloud

    Currently my Apple ID is an email address which I have been using for decades.  In the near future the email server will be decommissioned and I will no longer be able to use it.  In preparation of the change over I want to change my current email ad

  • Some Examples of FICO tickets regarding Automatic Payment Run,GL,AR,AP,Bank

    Hello, Could anybody please provide me with 5 or 6 examples of FICO tickets that we normally get during real time and their solutions regarding APP,AP,AR,GL,Bank and Cash I need it badly so kindly send me those tickets and the solutions if u can to m

  • Trying to install Adobe Acrobat DC.

    I get through the installation and then when I go to accept the agreement to register my product nothing happens.  The screen disapears and then it prompts me to restart when trying to open a PDF.

  • Mail- I click an email link and Mail opens, but nothing happens

    I dont use mail.app How can I disable it completely so that it wont bother me? Whenever I click an email link, i dont want Mail to open. It would be nice if my gmail opened though.

  • Fedex Delivery Question

    if i not going to be home. can a person over 18 sign for my iphone if i not there. thanks in advance.