For the relatively low cost of specifying your servlet mapping, you
can use the JSTL c:url/c:param tags and achieve all of this much more
concisely:
<c:url var="myUrl" value="/partDetailView.do">
<c:param name="storeNo" value="${stockingStoreSalesReviewForm.storeNumber}" />
<c:param name="storeName" value="${stockingStoreSalesReviewForm.storeName}" />
</c:url>
<a href="<c:out value="${myUrl}" />">Click Here</a>
There's an enhancement request filed to add "c:param" type
functionality to <html:link>, and I think I even assigned it to
myself, but to be honest, I am satisfied with the JSTL alternative
and haven't had (and don't expect to have) time to add an
"html:param" tag to the Struts JSTL just for the general good.
All that html:link provides in the specific case below is a lookup
function which (a) verifies that you have a valid action path at JSP
compile time and (b) gives you the freedom to change your mappings
from "*.do" to "*.foo" or anything else -- a freedom which is
probably compromised in most apps by the need to have external links
into the application, so which doesn't seem all that valuable to me.
Joe
At 11:10 AM +0100 6/23/05, Bob Arnott wrote:
Phani wrote:
Here is my code in the JSP page:
> <bean:define id="param1" name="stockingStoreSalesReviewForm"
property="storeNumber"/>
> <bean:define id="param2" name="stockingStoreSalesReviewForm"
property="storeName"/>
<%
java.util.HashMap params = new java.util.HashMap();
params.put("storeNo",param1);
> params.put("storeName",param2);
pageContext.setAttribute("storeInfo", params);
%>
<html:link action="/partDetailView"
paramName="storeInfo" scope="page"> Click Here
</html:link>
You want to specify the Map under the attribute "name", not "paramName", so:
<html:link action="/partDetailView" name="storeInfo"
scope="page">Click Here</html:link>
See -
http://struts.apache.org/userGuide/struts-html.html#link#
Cheers,
--
Bob Arnott
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]