Thanks for the reply Ed,
I have a quick question about paramId usage.
How about having a hidden parameter,
like
<html:hidden property="variable" value="value"/>
and doing
<html:link forward="myForward" paramID="myVariable" paramName="variable"
paramScope="someScope"> View Loyalty Page
</html:link>
Shouldn't this pass the "variable" in some Scope to be later retrieved
in the subsequent action etc. OR Do I HAVE TO bring a scalar property in
request/session scope from something before the JSP etc. ?
regards,
robin
Ed Griebel wrote:
A html:link will NOT send anything on the current form; it actually
doesn't even need to be inside a form.
Here's 2 approaches that I've used:
- generate the URL with <html:rewrite action=...> and store it in a
variable and just use a standard <a href=...> to generate the link,
and append the variables you want to when generating the href part
- use the <html:link> parameters paramId, paramName, and paramProperty:
-- paramId: the name on the URL
-- paramName: the scoped collection or POJO that contains the field
(omit if property is a scalar)
-- paramProperty: the name of the field in the above object, or the
name of a scalar-typed scoped variable
HTH,
-ed
On 11/20/06, robin bajaj <[EMAIL PROTECTED]> wrote:
Hi Folks,
I am trying to have an html:link in my jsp form. This form normally
submits to action Action1.do. (<html:form action"/Action1.do">)
But when clicked upon <html:link>, I want to do 2 things :
a) call a different action Action2.do
b) and "set the value and send" one variable (hidden parameter etc.) in
the request/session scope so that Action2.do can process it.
I have tried doing the following
-------------------
<html>
<body>
<html:form action ="/Action1.do">
<html:hidden property="variable" value="value"/>
<html:link forward="myForward"> View Loyalty Page
</html:link>
</html:form>
</body>
</html>
-------------------
Even though my "myForward" points to the right action ("Acton2.do") and
calls it successfully, I still cannot get to submit the "variable" with
its assigned value.
When I do request.getParameter("variable") in my Action2.do code,
I get "null" value.
How can i work around this situation? How about using paramid, paramname
attributes? I couldn't understand their correct usage from Struts 1.1
Api reference , some small snippet will be very helpful and much
appreciated.
Or Any other workarounds are most welcome .
thanks,
robin
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]