This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to pass a data through html:link in struts
 
Similar Threads
use html:link pass two param
pass object from one jsp to other using html:link
Passing parameters
Passing values in a form with multiple actions
Attempted a bean operation on a null object.