Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Found this Base64 impl that does a lot of the heavy lifting for me : <a href="http://iharder.net/base64" rel="nofollow">http://iharder.net/base64</a></p> <p>Has utility methods :</p> <pre><code> String encodeObject(java.io.Serializable serializableObject, int options ) Object decodeToObject(String encodedObject, int options, final ClassLoader loader ) </code></pre> <p>Using :</p> <pre><code>try { String dat = Base64.encodeObject(srlzblObj, options); StringBuilder data = new StringBuilder().append("type="); data.append(appObjTyp).append("&amp;obj=").append(java.net.URLEncoder.encode(dat, "UTF-8")); </code></pre> <p>Use the type param to tell the receiving JVM what type of object I'm sending. Each servlet/ jsps at most receives 4 types, usually 1. Again since its our own app and classes that we are sending this is quick (as in time to send over the network) and simple.</p> <p>On the other end unpack it by :</p> <pre><code> String objData = request.getParameter("obj"); Object obj = Base64.decodeToObject(objData, options, null); </code></pre> <p>Process it, encode the result, send result back:</p> <pre><code> reply = Base64.encodeObject(result, options); out.print("rsp=" + reply); </code></pre> <p>Calling servlet / jsp gets the result:</p> <pre><code> if (reply != null &amp;&amp; reply.length() &gt; 4) { String objDataFromServletParam = reply.substring(4); Object obj = Base64.decodeToObject(objDataFromServletParam, options, null); </code></pre> <p>options can be 0 or Base64.GZIP</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. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    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