Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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">
<tr>
<td>
<html:link action="/editNow" paramName="userDetailsForm" paramProperty="userId" paramId="userId">
<nested:write property="userId" />
</html:link>
</td>
<td>
<nested:write property="firstName" />
</td>
<td>
<nested:write property="lastName" />
</td>
<td>
<nested:write property="email" />
</td>

</tr>
</nested:iterate>


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

UID430 Yogesh Reddy a@b.com
UID440 James Wallach 1@2.com
UID450 Test Tester we@we.com


struts-config.xml
-----------------

<action path="/editNow"
scope="request"
type="com.registration.action.EditUserAction">
<forward name="success"
path="/pages/edituser.jsp" />
</action>

EditUserAction.java
-------------------

public class EditUserAction extends Action {

public ActionForward execute(ActionMapping mapping,ActionForm form,
HttpServletRequest request,HttpServletResponse response) {
try{
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.

Cheers,
Yogesh Reddy
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Duplicate Post, closing this one...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic