• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem about taglib (pager tag) in my jsp page

 
alsoumahi alBatal
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi experts , I am using taglib (dynamic loop) in my jsp page to show my records . the thing is each record has an edit button and delete button . so it appears something like below:

id name age email Edit delete
---------------------------------------------------------------------------------------------------------------------------------------------
1 nani 22 ***@hotmail.com editButton deleteButton
2 Tom 25 ***@hotmail.com editButton deleteButton



so I need to know how can I send the id to my editServlet or deleteServlet once user clicks editButton or deleteButton in order to do the proper process for that user ID

I can't set the request attribute like this request.setAttribute("ID",new Integer(id)) because id is always changeable so it takes last value not the one we clicked on
also I don't prefer to put id with URL , because it causes other problems with me

is there other ways guys

thanks in advance
 
Pravin Shirke
Ranch Hand
Posts: 152
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi alsoumahi,
what i can suggest is that try and assign your id to each deletebutton on your page using taglib, see if its possible. then it can be easily done on your servlet side once id's has been assigned. when that delete button is clicked get the value and delete that record.

Hope this helps
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is it a problem to have it in the URL? You could use a POST and have a form value.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set but buttons as "links" using "href=" and putting delete/edit images to look like buttons! ^^
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic