Priya,
As a short term solution you can create a new tag,as in myLibrary:link which 
derives from html:link and knows how to deal with AccountInfo bean. 
But if I may,I would suggest rethinking the architecture of your application, 
as in maintaining the AccountInfo object in session instead of passing it 
through URL encoding.
Cheers
Rahul


-----Original Message-----
From: priya [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 29, 2006 4:23 PM
To: Struts Users Mailing List
Subject: Re: Newbie question about using beans in html:link tags


Hi Rahul,

I was trying to reduce the amount of code if its possible (?) since the
action would display a jsp page with account information and then the user
would review the information & submit another action to finally create the
account.

Since I already have all the information in a bean I was hoping on getting
to know how to use beans instead of having to set attributes seperately.. I
have a lot of attributes to set other than name, id, etc...all this will be
passed around quite a lot..

Priya




On 11/29/06, Asthana, Rahul <[EMAIL PROTECTED]> wrote:
>
> Would you mind using jstl?
> <c:url value="/showCreate.do" var="url">
> <c:param name="firstName" value="${ai.getFname()}"/>
> <c:param name="lastName" value="${ai.getLname()}"/>
> </c:url>
> Caveat: I havent used it myself.But I remember having come across code
> like that.
> AFAIK, html:link doesnt support passing multiple params except by a Map.
>
> -----Original Message-----
> From: priya [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 29, 2006 3:25 PM
> To: Struts Users Mailing List
> Subject: Newbie question about using beans in html:link tags
>
>
> I am trying to use Struts for an account creation application
>
>
>    1. In my JSP page I am using a List (named results) to get account
>    information (name, id and more.. )
>    2. The list stores this information in an AccountInfo bean and I am
>    using a for loop to go through the List.
>    3. I am using a Map to pass values to the next Action and I was
>    wondering if I can use the AccountInfo Bean instead since it has all
> the
>    information?
>    4. I am not using a use:bean tag and just creating it as seen below
>    (AccountInfo ai = (AccountInfo) results.get(count);)
>
>
>
>               <%
>                 for (int count = 0; count < results.size; count++) {
>                 AccountInfo ai = (AccountInfo) results.get(count);
>               %>
>
>              <tr>
>                 <td><%=ai.getLname()%>, <%=ai.getFname()%> </td>
>                 <td><%=ai.getUsername()%></td>
>                 <td><%=ai.getId()%></td>
>
>
>               <%java.util.HashMap map =new java.util.HashMap();
>                 map.put("firstName", String.valueOf(ai.getFname()));
>                 map.put("lastName", String.valueOf(ai.getLname()));
>                 map.put("userName", String.valueOf(ai.getUsername()));
>                 pageContext.setAttribute("map",map);%>
>
>                 <td width="3%">
>                 <html:link page="/showCreate.do" name="map"><img
> src="images/acct.jpg" width="16" height="20" border="0" title="Create
> Account"></html:link>
>                 </td>
>              </tr>
>
>               <%}%>
>
> Any suggestions?
> Priya
>
> ---------------------------------------------------------------------
> 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