aspose file tools*
The moose likes Struts and the fly likes How to pass a data through html:link in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to pass a data through html:link in struts" Watch "How to pass a data through html:link in struts" New topic
Author

How to pass a data through html:link in struts

Abhilash
Greenhorn

Joined: Nov 02, 2004
Posts: 12
friends
I am working in struts frame work and i have to pass a data through the struts tag <html:link> as we do in HTML. The corresponding code in HTML will be like as follows

<a href='/LibraryManagement/StaffEditMember2.jsp?id=108>Edit</a>

On the target page we get the value of id using request.getParameter(id)

How can i replace <a> with <html:link>

Please help me
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Moving this thread to the Web Application Frameworks forum, since it is about Struts.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Suzanne Israel
Greenhorn

Joined: Aug 23, 2002
Posts: 11
Originally posted by Abhilash AT:
friends
I am working in struts frame work and i have to pass a data through the struts tag <html:link> as we do in HTML. The corresponding code in HTML will be like as follows

<a href='/LibraryManagement/StaffEditMember2.jsp?id=108>Edit</a>

On the target page we get the value of id using request.getParameter(id)

How can i replace <a> with <html:link>

Please help me


Try this:

<html:link href="/LibraryManagement/StaffEditMember2.jsp" paramId="id" paramName="id" paramScope="request">Edit</html:link>

You can also use paramName in conjunction with paramProperty if the value you want is contained within a bean rather than the request.

I hope this helps -

Suzanne Israel
SCJP 1.4
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to pass a data through html:link in struts