Meaningless Drivel is fun!
The moose likes Struts and the fly likes Need help in retrieving html:link paramter value in Action class. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply locked New topic

Need help in retrieving html:link paramter value in Action class.

yogi reddy

Joined: Aug 10, 2009
Posts: 18
Hello All,

I am learning sturts 1.3.8 by doing a registaration application.
So far I have completed the "add a new user & list the users" workflow successfully.

I am having a little challenge in editing an user workflow. . I would need someone's help in this. (I will keep trying myself as well)

snapshot of manageusers.jsp
<nested:iterate name="userDetailsForm" property="userDetails">
<html:link action="/editNow" paramName="userDetailsForm" paramProperty="userId" paramId="userId">
<nested:write property="userId" />
<nested:write property="firstName" />
<nested:write property="lastName" />
<nested:write property="email" />


This is the output rendered from manageusers.jsp all the UID WILL HAVE HYPERLINK

UID430 Yogesh Reddy
UID440 James Wallach
UID450 Test Tester


<action path="/editNow"
<forward name="success"
path="/pages/edituser.jsp" />

public class EditUserAction extends Action {

public ActionForward execute(ActionMapping mapping,ActionForm form,
HttpServletRequest request,HttpServletResponse response) {
System.out.println("I am in EditUserAction user id : "+request.getParameter("userId"));
} catch(Exception e) {
System.out.println("I am in EditUserAction Exception : "+e.getMessage());
return mapping.findForward(Constants.SUCCESS);

What I need from you guys ?

Currently when I click the UID's I am getting the request parameter as null in EditUserAction.
I am sure that I am NOT appending the UID to the hyperlink in manageusers.jsp
because I do not know how to do that (tried couple of approaches but in vain ).

Any thoughts or suggestions on how to do this? Thanks in advance for your time.

Yogesh Reddy
Ankit Garg

Joined: Aug 03, 2008
Posts: 9452

Duplicate Post, closing this one...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
I agree. Here's the link:
subject: Need help in retrieving html:link paramter value in Action class.
It's not a secret anymore!