You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ul...@theinbox.org on 2002/02/14 14:46:11 UTC

Hello,

I am new to Struts and I hope someone can help with this problem:

I am using the iterate tag to disply some obejects (like this 

<logic:iterate id="mybean" name="MyForm" property="mybeans"> 
and I can write the data like <bean:write name="mybean" property="x"/> etc. )

For each iteration i want to create a link to a servlet. 

The link will contain values from the object so each link will differ from the 
other links, like

"/servletname?x1=valuex1&y1=valuey1"
"/servletname?x2=valuex2&y2=valuey2"
"/servletname?x3=valuex3&y3=valuey3"

Each link string will be created by calling a 'getRequestString(x,y)' in the 
corresponding form bean (MyForm). 

How do a make this link?

I want to do something like
<html:link page="MyForm.getRequestString(
 <bean:write name="mybean" property="x"/>,
 <bean:write name="mybean" property="y"/>)
</html:link>

I hope you understand what I would like to do!

Thanks, 

Ulrika              


-- 
Get your firstname@lastname email at http://Nameplanet.com/?su

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Posted by Keith <ke...@yahoo.com>.
Did u search the archives? - you should be able to find examples there.
http://www.mail-archive.com/struts-user@jakarta.apache.org/

Here's how I do links - people say don't use scriptlets but this can handle 1
or more parms easily & is quite readable. 

	<% String linkMaintURL = "linkList.do?value1="+                               
                      myBean.getX() + "&value2"=myBen.getY();;
	%>
	<html:link href="<%=linkMaintURL %>">
		<bean:message key="Biff1.common.edit"/>&nbsp;link
	</html:link>

Read the docs on link tag for
the official way. Struts example has this functionality too.
Remember it takes quite a long time & much pain to learn struts.

 
--- ulrika@theinbox.org wrote:
> Hello,
> 
> I am new to Struts and I hope someone can help with this problem:
> 
> I am using the iterate tag to disply some obejects (like this 
> 
> <logic:iterate id="mybean" name="MyForm" property="mybeans"> 
> and I can write the data like <bean:write name="mybean" property="x"/> etc. )
> 
> For each iteration i want to create a link to a servlet. 
> 
> The link will contain values from the object so each link will differ from
> the 
> other links, like
> 
> "/servletname?x1=valuex1&y1=valuey1"
> "/servletname?x2=valuex2&y2=valuey2"
> "/servletname?x3=valuex3&y3=valuey3"
> 
> Each link string will be created by calling a 'getRequestString(x,y)' in the 
> corresponding form bean (MyForm). 
> 
> How do a make this link?
> 
> I want to do something like
> <html:link page="MyForm.getRequestString(
>  <bean:write name="mybean" property="x"/>,
>  <bean:write name="mybean" property="y"/>)
> </html:link>
> 
> I hope you understand what I would like to do!
> 
> Thanks, 
> 
> Ulrika              
> 
> 
> -- 
> Get your firstname@lastname email at http://Nameplanet.com/?su
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>