Thanks Erik/Mark,

I can't use applets so I will URLEncode the values and send them as
parameters in a post.

Thanks again for your help.

Jim.

> -----Original Message-----
> From: Erik Price [mailto:[EMAIL PROTECTED]
> Sent: 27 March 2003 13:38
> To: Tomcat Users List
> Subject: Re: OT Dumb JavaScript question
> 
> 
> 
> 
> Collins, Jim wrote:
> > Hi Guys,
> > 
> > This is probably a dumb question, does anyone know if is 
> possible to use
> > JavaScript objects from a servlet? 
> > 
> > When a user makes some selections I want to add objects to 
> an associative
> > array I would then like to be able to access this 
> associative array and save
> > the values to a database from a servlet.
> 
> There really isn't a simple way to do this, since for the 
> user-agent to 
> communicate with the servlet, an HTTP request must be submitted 
> (containing the POST or GET data you wish to "say").
> 
> You can use JavaScript to create an array of information and then 
> communicate this to the servlet with the submission of a form 
> etc, but 
> you will have to "protect" (encode) the JavaScript data in 
> such fashion 
> as to
>   1. survive the HTTP transmission
>   2. be understood by the servlet
> I am not sure if JavaScript has built-in serialization to do this.  I 
> think it would be easiest to assemble a simple URL-encoded string of 
> data that is then URL-decoded by the servlet and parsed to 
> extract the 
> information.
> 
> You may wish to investigate using an applet, since an applet 
> can provide 
> the same dynamic interface as JavaScript in addition to being able to 
> speak "natively" to the servlet.
> 
> 
> 
> Erik
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


PLEASE READ: The information contained in this email is confidential
and intended for the named recipient(s) only. If you are not an intended
recipient of this email you must not copy, distribute or take any 
further action in reliance on it and you should delete it and notify the
sender immediately. Email is not a secure method of communication and 
Nomura International plc cannot accept responsibility for the accuracy
or completeness of this message or any attachment(s). Please examine this
email for virus infection, for which Nomura International plc accepts
no responsibility. If verification of this email is sought then please
request a hard copy. Unless otherwise stated any views or opinions
presented are solely those of the author and do not represent those of
Nomura International plc. This email is intended for informational
purposes only and is not a solicitation or offer to buy or sell
securities or related financial instruments. Nomura International plc is
regulated by the Financial Services Authority and is a member of the
London Stock Exchange.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to