• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

problem about taglib (pager tag) in my jsp page

 
Ranch Hand
Posts: 119
  • 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
 
Ranch Hand
Posts: 152
Eclipse IDE Chrome 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
 
Author
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.
 
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! ^^
 
LOOK! OVER THERE! (yoink) your tiny ad is now my tiny ad.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic