I sometimes have to do things like this. You can only submit strings in the
request, so what you want is a method of representing your information as a
string in a simple way.

In this case it should be quite easy as its just an array of a simple
structure of two ints so Id probably just have two delimiters, one for the
values in the structure, and one for the structures, so for example I might
submit the lot in a hidden field as something like:

1,32;2,48;3,10;4,50


Where I use a comma to delimit between the colIndex and newWidth values, and
a semicolon to seperate each instance of the structure. You can use any old
char as a delimiter so long as it wont be confused with the values. Since
these are ints and not strings life is easy in this case!

Over on the server side you have some code that parses this string to
reconstitute the values into some kind of java classes. You may even want to
do it in your action forms setter or getter - where you pass the string when
it is set and have a (differently named) getter that can return it as the
equivelent Structure[]

-----Original Message-----
From: Robert Taylor [mailto:[EMAIL PROTECTED]
Sent: Friday, 12 March 2004 10:24
To: Struts Users Mailing List
Subject: RE: can anyone help me address this issue


You can't send "data structures" over HTTP you can only send strings.

You could set those values as hidden form elements with a naming
convention that would enable your server side code to recognize
the elements in the request and create the appropriate server side
data structure. This is essentially what Chris has suggested.

robert

> -----Original Message-----
> From: Mu Mike [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 11, 2004 8:25 PM
> To: [EMAIL PROTECTED]
> Subject: RE: can anyone help me address this issue
>
>
> Sorry,maybe I didnt make my question clear
> my question is:
>
> the java script variable is supposed to be an array of such a
> strutcture(although java doesnt have a struture, I just use it here to
> describe my idea,maybe I should use a class instead) ,I d like to know how
> I can submit such a value?
>
>
> Structure[] javascriptvalue;
>
> Structure{
>  int colIndex
>  int newWidth
> }
>
>
> Thanks&Regards
>
>
>
> >From: "McCormack, Chris" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Subject: RE: can anyone help me address this issue
> >Date: Thu, 11 Mar 2004 12:24:43 -0000
> >
> >use onResize on the html element that is clicked to report its new value
> to a form variable. use an onChange for the form to auto submit itself. If
> you need to hide the submission of the form use an IFrame.
> >
> >messy eugh, javascript is the pits.
> >
> >Chris
> >
> >-----Original Message-----
> >From: Mu Mike [mailto:[EMAIL PROTECTED]
> >Sent: 11 March 2004 12:16
> >To: [EMAIL PROTECTED]
> >Subject: RE: can anyone help me address this issue
> >
> >
> >I really need to get some idea about this issue, any suggestions?
> >
> >Thanks&Regards
> >
> >
> > >From: "Mu Mike" <[EMAIL PROTECTED]>
> > >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > >To: [EMAIL PROTECTED]
> > >Subject: can anyone help me address this issue
> > >Date: Thu, 11 Mar 2004 05:12:16 +0000
> > >
> > >I m using javascript "doing" dhtml, now  I have a table, every time
> > >a user changes the width of a specific column(by draging the border
> > >line), I will save the column index and the new width to variables
> > >in javascript.Now ,after doing many such changes, I need to submit
> > >those values saved in the vairables to the server side program by
> > >submiting a form, which has an action path designing what action
> > >should be called after it get the submitted value. Now, I m
> > >wondering how I should define such javasript variables and how I can
> > >submit these values by submiting a form? I m using struts, is there
> > >any possibility to implement this idea in struts?
> > >
> > >Thanks&Regards
> > >
> > >_________________________________________________________________
> > >享用世界上最大的电子邮件系统― MSN Hotmail。  http://www.hotmail.com
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >_________________________________________________________________
> >与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >***********************************************
> >This e-mail and its attachments are confidential
> >and are intended for the above named recipient
> >only. If this has come to you in error, please
> >notify the sender immediately and delete this
> >e-mail from your system.
> >You must take no action based on this, nor must
> >you copy or disclose it or any part of its contents
> >to any person or organisation.
> >Statements and opinions contained in this email may
> >not necessarily represent those of Littlewoods.
> >Please note that e-mail communications may be monitored.
> >The registered office of Littlewoods Limited and its
> >subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB.
> >Registered number of Littlewoods Limited is 262152.
> >************************************************
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> _________________________________________________________________
> 享用世界上最大的电子邮件系统― MSN Hotmail。  http://www.hotmail.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



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

Reply via email to