• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html:link

 
clyde melly
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
c'mon help me out.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mark Hartnett
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
core JSTL handles this very nicely using c:url with nested c:param tags
JSTL api
[ March 03, 2005: Message edited by: Marc Peabody ]
 
clyde melly
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic