At 5:51 AM +0000 3/30/04, Mu Mike wrote:
no one cares about my uncertainty?

Have a look at the source code, particularly RequestProcessor.processActionForm and RequestUtils.createActionForm


You can get the source in lots of places, but here are a few links:

http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apache/struts/action/RequestProcessor.java?rev=1.30&view=markup
http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apache/struts/util/RequestUtils.java?rev=1.105&only_with_tag=STRUTS_1_1&view=markup

note that those links are the the Struts 1.1 released versions of those classes; if you are using a newer version, there have been some changes.

Joe



From: "Mu Mike" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: how to initiate an actionform?
Date: Tue, 30 Mar 2004 01:24:55 +0000

thanks
what I m wondering is whether it creates only one instance of the actionform in the scope(session,request..) if so, I can just create an instance of my actionform in the jsp file and initiate it , then the form my action class got is this instance?


Thanks&Regards
Mike

From: Bill Siggelkow <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: how to initiate an actionform?
Date: Mon, 29 Mar 2004 12:40:49 -0500

Mu,

I think what you want to do is provide an action that sets up your
form prior to forwarding to the JSP page.  In that action, you can set
the String[] to hold the values that you want checked for rendering by
html:multibox.  For example, let's say your form is something like the
following:

public MyForm extends ActionForm {
  private String[] multiboxValues;

  public String[] getMultiboxValues() {
    if (mulitboxValues == null) multiboxValues = new String[] {};
    return multiboxValues;
  }
  public setMultiboxValues(String[] vals) {
    multiboxValues = vals;
  }
}

Create an Action that forwards to the JSP page in its action mapping.
Then in the Action initialize the multiboxValues however is needed.
Something like the following:

public EditMultiboxAction extends Action {
  public ActionForward execute(...) {
    MyForm myform = (MyForm) form;
    // call the business service to get the default settings
    String[] checkedVals = getDefaulSettings();
    form.setMultiboxValues( checkedVals );

    return mapping.findForward( "success" );
  }
}

FYI: The above would be used if your form was in session scope.
If not, then push the appropriate data into the request.

Let me know if you have any questions.

Bill

Mu Mike wrote:
 I m using a htmol:multibox tag, I want the check boxes checked or
 unchecked every time differently accoriding to the data I have in my
jsp
> file, I m using an action form ,it has a string[] property, But I dont
know how to initate the property with the data I have in jsp file.

any good suggestions?

 Thanks&Regards
 Mike

 _________________________________________________________________
 ^IFsCgp MSN Messenger:
http://messenger.msn.com/cn


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


_________________________________________________________________ ^IFsCgp MSN Messenger: http://messenger.msn.com/cn


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


_________________________________________________________________ pEIq" nՄ- MSN HotmailB http://www.hotmail.com

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


--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
"Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining."
-- Jef Raskin


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



Reply via email to