Okay, I changed my page to look like this.

        <logic:iterate  name="SearchForm" property="result" id="user">
        <tr>
          <td align="center"><bean:write name="user"
property="username"/>&nbsp;</td>
          <td align="center">
                <html:link forward="modifyUser" paramName="user" paramId="UserForm" >
                Modify
                </html:link>
            </td>
        </tr>
        </logic:iterate>

this produces a link like
:http://.../user_mod.jsp?UserForm=edu.erau...form.UserForm%40ff5bdefc

I have a global action "modifyUser" with a path to /<path>/user_mod.jsp.
I am able to pick up the UserForm parameter in ModifyUser, but I am unable
to use it as the UserForm bean.  Am I passing a reference to the UserForm
Bean, or just a name?  how do I reconstruct the UserForm bean in ModifyUser?
I experimented with <bean:(define,include and parameter)../> with no
success.

I'm sorry if these questions are simplistic, but I am new to jsp, and
especially struts.

Also, in the origional example, the global path is to a .do file.  I was
under the impression that the ".do" files were generated by the server.  Do
I need to have a generated page waiting to receive my request?  How is this
done?

thnxs again,
David


-----Original Message-----
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 22, 2001 12:10 PM
To: [EMAIL PROTECTED]
Subject: Re: html action links


If you just want to use html:link, you don't necessarily have to use an
ActionForm class (though you can, if you want).

Here's some code for generating a list with links. Result is a bean that
exposes a collection named rows.

<logic:iterate name="result" property="rows" id="row">
<p>
      <html:link forward="donor" paramName="row" paramId="key"
paramProperty="donor">
        <bean:write name="row" property="donor" filter="true"/>
      </html:link>
</p>
</logic:iterate>

When the page renders, it generates links like this:

<a
href="http://localhost/struts-stub/donor/View.do?key=123456";>123456</a>

where there is a global forward "donor" with the path "/donor/View.do"

and row.getDonor() returns 123456

DHarty wrote:
>
> This is really a two part question.
>
> I have an iterative loop that displays a list users that are stored in
> Action Forms.  The idea is that when the button (or link) next to the item
> is selected, the user will be allowed to make modifications to the
selected
> form:
>
>   <logic:iterate id="user" name="SearchForm" property="result">
>   <tr>
>         <html:form action="/usermodify">
>         <td align="center">
>                 <bean:write name="user" property="username"/>
>         </td>
>         <td align="center">
>                 <html:submit property="username">Modify
>                 </html:submit>
>         </td>
>         </html:form>
>   </tr>
>   </logic:iterate>
>
> Where "result" is a vector of ActionForms.
>
> Currently, when the "Modify" button is selected, the appropriate action
> class is called, but the ActionForm is reset.
>
> I know I could add a field to the submit button, i.e:
>
>         <html:submit property="username">Modify <bean:write
> property="username"/></html:submit>
>
> and then have the action class look up the user in hte database again, but
I
> would rather not.
>
> I was considering using an html link instead of a button, but was unsure
how
> to proceed.
> Ideally, I would like to use an html link, while retaining the existing
form
> (without having to look it up again).
>
> Any thoughts or comments would be appreciated.
>
> Thnxs
>
> David

Reply via email to