my dog learned polymorphism
The moose likes JSP and the fly likes problem about  taglib (pager tag) in my jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "problem about  taglib (pager tag) in my jsp page" Watch "problem about  taglib (pager tag) in my jsp page" New topic

problem about taglib (pager tag) in my jsp page

alsoumahi alBatal
Ranch Hand

Joined: Nov 22, 2009
Posts: 103
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 *** editButton deleteButton
2 Tom 25 *** 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

Joined: Apr 05, 2008
Posts: 150

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

[Vipassana] - It is seeing the reality as it is, And not as you want it to be.!!!
David Newton

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jul 14, 2010
Posts: 754

You can set but buttons as "links" using "href=" and putting delete/edit images to look like buttons! ^^

[] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
I agree. Here's the link:
subject: problem about taglib (pager tag) in my jsp page
It's not a secret anymore!