On 4/20/07, john lee <[EMAIL PROTECTED]> wrote:
what is S1 tags? i still use struts 1.3.8.

Struts 1.x. S2 would be Struts 2.x. So, with 1.3.8, you are still using S1.

  So, no possible to submit formay array?

> possible for me to implement the following code?
> >         for (i=1:i>         {
>        response.Write("> styleId="+i);
>        response.Write("> value="+i);
>        response.Write("");
>        response.Write("");
>    }
>   %>
>
> but, how to capature form(0), form(1) with
> corrsponsed part inside ActionForm ?


I think you could get the Struts tags to be interpreted if you wrapped
them in a <logic:iterate/> tag or a <c:forEach/> tag, rather than in a
loop in a scriptlet. I can't imagine how it would work beyond that,
though. I guess since only one form is actually posted back, you'd be
OK as long as it went to an action with a form bean that matched the
form?

If the goal is just to have multiple submit buttons on the page that
do different things, you might try another approach:

Have one <html:form/> with multiple <html:submit/> tags, each one
having an onclick handler e.g.,

<html:submit onclick="doSubmitOne()" .../>

Then, in Javascript, you could alter the action of the form like this:

function doSubmitOne() {
   var form = document.forms["myForm"];
   form.action += "?method=submitOne";
   form.submit();
}

Thus, the action would become "sth.do?method=submitOne", and then in
your Action class you would have a form bean that could handle all the
fields from all your separate forms, and one method for each submit
button that would look at just the fields appropriate to that action.
Does that make sense?

It might not be the cleanest method, but it's not unlike something
I've used in the past.

Good luck,
David Conrad

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

Reply via email to