You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Mike R. Phelan" <mr...@vsticorp.com> on 2003/12/23 02:04:13 UTC
capture the output of a logic:iterate and place it in the URI of an html:link forward
Hi folks,
I'm trying to add a parameter to a hyperlink, but I don't have direct access to the value I want to use in the parameter. I don't have direct access because the value is held within an ArrayList object, and only referenced with a logic:iterate call in a JSP page.
I have thoroughly searched the mailing list archive and wider Internet, as well as "Struts in Action." I have found some related material, but nothing that does exactly what I need to do.
I have an ArrayList of Objects that I've placed in the HTTP Request object.
LogonAction.java excerpt:
...
session.setAttribute("concur", group.getConcurrencesList());
...
Each item in the ArrayList consists of two Strings, named projectName and concurrenceStatus .
I am iterating through that on a JSP page, using a logic:iterate tag.
portal.jsp excerpt:
...
<TABLE>
<logic:iterate id="concur" name="concur"> <!-- concur contains the ArrayList -->
<TR>
<TD><html:link forward="concurrence">
<bean:write name="concur" property="projectName">
</html:link>
</TD>
<TD><bean:write name="concur" property="concurrenceStatus"/>
</TD>
</TR>
</logic:iterate>
</TABLE>
...
This results in the projectName and concurrenceStatus value pairs of every item in the ArrayList "concur" being printed to the page, in a table. The projectName values render as hyperlinks to project.jsp, the site specified in the struts-config.xml.
excerpts from struts-config.xml
...
<forward name="concurrence" path="/Concurrence.do"/>
...
<action
path="/Concurrence"
type="org.apache.struts.actions.ForwardAction"
parameter="/pages/project.jsp"/>
...
I want to take the property projectName and append its value to the URI referenced by the hyperlink.
I have tried using the technique referenced in SIA 6.4.1, as well as the technique referenced in
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg89289.html
I can't quite get it working. I'd really appreciate any help.
thanks,
Mike Phelan
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: capture the output of a logic:iterate and place it in the URI of an html:link forward
Posted by Kris Schneider <kr...@dotech.com>.
How 'bout adding it as a request parameter instead of appending it?
<TABLE>
<logic:iterate id="concur" name="concur"> <!-- concur contains the ArrayList -->
<TR>
<TD><html:link forward="concurrence"
paramId="projectName"
paramName="concur"
paramProperty="projectName">
<bean:write name="concur" property="projectName">
</html:link>
</TD>
<TD><bean:write name="concur" property="concurrenceStatus"/>
</TD>
</TR>
</logic:iterate>
</TABLE>
Quoting "Mike R. Phelan" <mr...@vsticorp.com>:
> Hi folks,
>
> I'm trying to add a parameter to a hyperlink, but I don't have direct access
> to the value I want to use in the parameter. I don't have direct access
> because the value is held within an ArrayList object, and only referenced
> with a logic:iterate call in a JSP page.
>
> I have thoroughly searched the mailing list archive and wider Internet, as
> well as "Struts in Action." I have found some related material, but nothing
> that does exactly what I need to do.
>
> I have an ArrayList of Objects that I've placed in the HTTP Request object.
>
> LogonAction.java excerpt:
> ...
> session.setAttribute("concur", group.getConcurrencesList());
> ...
>
> Each item in the ArrayList consists of two Strings, named projectName and
> concurrenceStatus .
> I am iterating through that on a JSP page, using a logic:iterate tag.
>
> portal.jsp excerpt:
> ...
> <TABLE>
> <logic:iterate id="concur" name="concur"> <!-- concur contains the ArrayList
> -->
> <TR>
> <TD><html:link forward="concurrence">
> <bean:write name="concur" property="projectName">
> </html:link>
> </TD>
> <TD><bean:write name="concur" property="concurrenceStatus"/>
> </TD>
> </TR>
> </logic:iterate>
> </TABLE>
> ...
>
> This results in the projectName and concurrenceStatus value pairs of every
> item in the ArrayList "concur" being printed to the page, in a table. The
> projectName values render as hyperlinks to project.jsp, the site specified in
> the struts-config.xml.
> excerpts from struts-config.xml
> ...
> <forward name="concurrence" path="/Concurrence.do"/>
> ...
> <action
> path="/Concurrence"
> type="org.apache.struts.actions.ForwardAction"
> parameter="/pages/project.jsp"/>
> ...
>
> I want to take the property projectName and append its value to the URI
> referenced by the hyperlink.
>
> I have tried using the technique referenced in SIA 6.4.1, as well as the
> technique referenced in
> http://www.mail-archive.com/struts-user@jakarta.apache.org/msg89289.html
>
> I can't quite get it working. I'd really appreciate any help.
>
> thanks,
>
> Mike Phelan
--
Kris Schneider <ma...@dotech.com>
D.O.Tech <http://www.dotech.com/>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: How to perform update records faster?
Posted by Andrew Hill <an...@gridnode.com>.
You asked this just 10 minutes ago. This post is identical and adds no new
information.
Please do not spam the list like that. It is rather rude.
http://www.catb.org/~esr/faqs/smart-questions.html
-----Original Message-----
From: Julia Weaver [mailto:dreamweaver_y03@yahoo.com]
Sent: Tuesday, 23 December 2003 22:24
To: Struts Users Mailing List
Subject: How to perform update records faster?
Hi All,
Can someone please tell me how I able to do
update/modify records faster? My user need to
click/select individual records to update in one big
table(or one web page). Since there are so many
records need to update continually, is a way can
perform faster? Someone told me using session and
Arraylist, another person told me using pop-up window,
but I do not know how to use these specifially, can
anyone help me?
Thanks,
__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
How to perform update records faster?
Posted by Julia Weaver <dr...@yahoo.com>.
Hi All,
Can someone please tell me how I able to do
update/modify records faster? My user need to
click/select individual records to update in one big
table(or one web page). Since there are so many
records need to update continually, is a way can
perform faster? Someone told me using session and
Arraylist, another person told me using pop-up window,
but I do not know how to use these specifially, can
anyone help me?
Thanks,
__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: capture the output of a logic:iterate and place it in the URI
of an html:link forward
Posted by James Mitchell <jm...@apache.org>.
1. Do not use the same name for 'id' and 'name' in your iterate tag.
(I made it plural)
session.setAttribute("concurs", group.getConcurrencesList());
^^^
2. You can easily create a map for use with links or other tags like so:
<jsp:useBean id="mapOfKeyValues" class="java.util.HashMap"/>
<TABLE>
<logic:iterate id="concur" name="concurs"> <!-- concur contains the
ArrayList -->
<!-- this value get overwritten with each iteration -->
<c:set target="${mapOfKeyValues}" property="someKey"
value="${concur.someProperty}"/>
<TR>
<TD>
<html:link forward="concurrence" name="mapOfKeyValues">
<bean:write name="concur" property="projectName">
</html:link>
</TD>
<TD><bean:write name="concur" property="concurrenceStatus"/>
</TD>
</TR>
</logic:iterate>
</TABLE>
Hope that helps.
On Mon, 22 Dec 2003, Mike R. Phelan wrote:
> Hi folks,
>
> I'm trying to add a parameter to a hyperlink, but I don't have direct access to the value I want to use in the parameter. I don't have direct access because the value is held within an ArrayList object, and only referenced with a logic:iterate call in a JSP page.
>
> I have thoroughly searched the mailing list archive and wider Internet, as well as "Struts in Action." I have found some related material, but nothing that does exactly what I need to do.
>
> I have an ArrayList of Objects that I've placed in the HTTP Request object.
>
> LogonAction.java excerpt:
> ...
> session.setAttribute("concur", group.getConcurrencesList());
> ...
>
> Each item in the ArrayList consists of two Strings, named projectName and concurrenceStatus .
> I am iterating through that on a JSP page, using a logic:iterate tag.
>
> portal.jsp excerpt:
> ...
> <TABLE>
> <logic:iterate id="concur" name="concur"> <!-- concur contains the ArrayList -->
> <TR>
> <TD><html:link forward="concurrence">
> <bean:write name="concur" property="projectName">
> </html:link>
> </TD>
> <TD><bean:write name="concur" property="concurrenceStatus"/>
> </TD>
> </TR>
> </logic:iterate>
> </TABLE>
> ...
>
> This results in the projectName and concurrenceStatus value pairs of every item in the ArrayList "concur" being printed to the page, in a table. The projectName values render as hyperlinks to project.jsp, the site specified in the struts-config.xml.
> excerpts from struts-config.xml
> ...
> <forward name="concurrence" path="/Concurrence.do"/>
> ...
> <action
> path="/Concurrence"
> type="org.apache.struts.actions.ForwardAction"
> parameter="/pages/project.jsp"/>
> ...
>
> I want to take the property projectName and append its value to the URI referenced by the hyperlink.
>
> I have tried using the technique referenced in SIA 6.4.1, as well as the technique referenced in
> http://www.mail-archive.com/struts-user@jakarta.apache.org/msg89289.html
>
> I can't quite get it working. I'd really appreciate any help.
>
> thanks,
>
> Mike Phelan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
--
James Mitchell
Software Developer / Struts Evangelist
http://www.struts-atlanta.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org