You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Anjib Mulepati <an...@hotmail.com> on 2011/10/03 20:24:20 UTC

Accessing variable in View [S 1.3.8]

Hi All,

I was wondering is there any way to read and store value of beans in JSP 
using Struts 1.3.8. I need this to pass the parameter as follow.

<logic:iterate id="group" name="groupList">
<tr class="gradeA" id='<bean:write name="group" property="groupId" />'>
<td style="text-align: center"><input type="checkbox" value="ON" 
name="del" /></td>
<td><html:link action="/getGroupDetail?id=*I need to get group id 
here*"><bean:write name="group" property="groupName" /></html:link> </td>
</tr>
</logic:iterate>

Thanks,
Anjib

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Accessing variable in View [S 1.3.8]

Posted by Li Ying <li...@gmail.com>.
I took a quick look at Struts1 document.

Looks like the following information can help:
http://struts.apache.org/1.x/struts-taglib/tagreference.html#html:link

========= START =========

To specify a single parameter, use the paramId attribute to define the
name of the request parameter to be submitted. To specify the
corresponding value, use one of the following approaches:

    Specify only the paramName attribute - The named JSP bean
(optionally scoped by the value of the paramScope attribute) must
identify a value that can be converted to a String.
    Specify both the paramName and paramProperty attributes - The
specified property getter method will be called on the JSP bean
identified by the paramName (and optional paramScope) attributes, in
order to select a value that can be converted to a String.

If you prefer to specify a java.util.Map that contains all of the
request parameters to be added to the hyperlink, use one of the
following techniques:

    Specify only the name attribute - The named JSP bean (optionally
scoped by the value of the scope attribute) must identify a
java.util.Map containing the parameters.
    Specify both name and property attributes - The specified property
getter method will be called on the bean identified by the name (and
optional scope) attributes, in order to return the java.util.Map
containing the parameters.

As the Map is processed, the keys are assumed to be the names of query
parameters to be appended to the hyperlink. The value associated with
each key must be either a String or a String array representing the
parameter value(s), or an object whose toString() method will be
called. If a String array is specified, more than one value for the
same query parameter name will be created.

========= END =========



2011/10/4 Anjib Mulepati <an...@hotmail.com>:
> Hi All,
>
> I was wondering is there any way to read and store value of beans in JSP
> using Struts 1.3.8. I need this to pass the parameter as follow.
>
> <logic:iterate id="group" name="groupList">
> <tr class="gradeA" id='<bean:write name="group" property="groupId" />'>
> <td style="text-align: center"><input type="checkbox" value="ON" name="del"
> /></td>
> <td><html:link action="/getGroupDetail?id=*I need to get group id
> here*"><bean:write name="group" property="groupName" /></html:link> </td>
> </tr>
> </logic:iterate>
>
> Thanks,
> Anjib
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org