Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Create your own <code>SerializableCookie</code> class which <a href="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html" rel="noreferrer"><code>implements Serializable</code></a> and just copy the <code>Cookie</code> properties during its construction. Something like this:</p> <pre><code>public class SerializableCookie implements Serializable { private String name; private String path; private String domain; // ... public SerializableCookie(Cookie cookie) { this.name = cookie.getName(); this.path = cookie.getPath(); this.domain = cookie.getDomain(); // ... } public String getName() { return name; } // ... } </code></pre> <p>Ensure that all properties itself are also serializable. Apart from the primitives, the <code>String</code> class for example itself already <code>implements Serializable</code>, so you don't have to worry about that.</p> <p>Alternatively you can also wrap/decorate the <code>Cookie</code> as a <code>transient</code> property (so that it doesn't get serialized) and override the <code>writeObject()</code> and <code>readObject()</code> methods <a href="http://java.sun.com/developer/technicalArticles/Programming/serialization/" rel="noreferrer">accordingly</a>. Something like:</p> <pre><code>public class SerializableCookie implements Serializable { private transient Cookie cookie; public SerializableCookie(Cookie cookie) { this.cookie = cookie; } public Cookie getCookie() { return cookie; } private void writeObject(ObjectOutputStream oos) throws IOException { oos.defaultWriteObject(); oos.writeObject(cookie.getName()); oos.writeObject(cookie.getPath()); oos.writeObject(cookie.getDomain()); // ... } private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException { ois.defaultReadObject(); cookie = new Cookie(); cookie.setName((String) ois.readObject()); cookie.setPath((String) ois.readObject()); cookie.setDomain((String) ois.readObject()); // ... } } </code></pre> <p>Finally use that class instead in the <code>List</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload