aspose file tools*
The moose likes Struts and the fly likes html:link Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:link " Watch "html:link " New topic
Author

html:link

clyde melly
Ranch Hand

Joined: Sep 04, 2003
Posts: 152
<html:link action="bookEdit.do?do=editBook"
paramProperty="id"
paramId="id">Edit</html:link>

The id value is basically values which i'm getting thru the get method of the form bean.Once clicked on the link the edit action class is invoked.No i'm trying to retrieve the id value by request.getParameter("id").it gives the value null.How can I get the value for the id.Help required.
clyde melly
Ranch Hand

Joined: Sep 04, 2003
Posts: 152
c'mon help me out.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'm a little unclear as to what exactly you're trying to do here. If all you want to do is display the value of "id" in the request, here's how you'd do it:


This assumes that whatever is in "id" is a string or has a toString() method.

If you're trying to pass the value of request.getAttribute("id") as a parameter on a link, here's how you'd do it:

<html:link action="bookEdit" paramId="id" paramName="id" paramScope="request"/>

good luck.

Merrill


Merrill
Consultant, Sima Solutions
Mark Hartnett
Greenhorn

Joined: Mar 01, 2005
Posts: 4
You need to add the paramName attribute to the tag. The paramName is the name of the form that contains the value you are trying to get the id from.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

core JSTL handles this very nicely using c:url with nested c:param tags
JSTL api
[ March 03, 2005: Message edited by: Marc Peabody ]

A good workman is known by his tools.
clyde melly
Ranch Hand

Joined: Sep 04, 2003
Posts: 152
I tried using all the help provided but it still doesn't work.Let me explain what I need to accomplish.Once i click on the link the value of id should be available in the book edit action class when i do a req.getParameter("id").
Mark Hartnett
Greenhorn

Joined: Mar 01, 2005
Posts: 4
The correct syntax is as Merrill describes in her post.

The only difference may that your bean is in Session scope not request.

You should post the html that is being rendered from your tag to see if it is correct.
[ March 04, 2005: Message edited by: Mark Hartnett ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: html:link