I don't know if this will help you but a word of warning, do not accept an
object submitted through a web interface unless you know what it is. That
said, to cache object state I have loaded a hidden field with serialized
data so that I could retrieve it. Below is the serialize but I left off the
Base64.encode and decode methods you will need to store it safely in a html
input filed.

public class SerializableObject {
        
        public static ByteArrayOutputStream serialize(Object obj) throws Exception{
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                ObjectOutputStream fout = new ObjectOutputStream( out );
                fout.writeObject(obj);
                return out;
        }
        
        public static Object deSerialize(InputStream in) throws Exception{
                ObjectInputStream fin = new java.io.ObjectInputStream(in);
                return fin.readObject();
        }
}

>On         Fri, 16 Apr 2004 13:48:31 -0600 "F. Sindran"
<[EMAIL PROTECTED]> wrote.
>Hello!

>

>In struts html:hidden tag only accepts form fields of javaLang type string.

>I need when I submit the form, the action will be able to receive a java

>object, for instance, a javalang list.

>Another option that can resolve the problem, would be add an attribute

>(list) to the request inside jsp page. Is it possible?

>

>Thanks in advance.

>

>--

>Un cordial saludo,

>F. Sindrán

>

>===========================================================================

>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff

>JSP-INTEREST".

>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST

>DIGEST".

>

>Some relevant archives, FAQs and Forums on JSPs can be found at:

>

> http://java.sun.com/products/jsp

> http://archives.java.sun.com/jsp-interest.html

> http://forums.java.sun.com

> http://www.jspinsider.com

>

>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

Reply via email to