File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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
Author

problem about taglib (pager tag) in my jsp page

alsoumahi alBatal
Ranch Hand

Joined: Nov 22, 2009
Posts: 94
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

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.!!!
SCJP1.5.
David Newton
Author
Rancher

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! ^^


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem about taglib (pager tag) in my jsp page
 
Similar Threads
send a variable id to a deleteServlet how?
Do Not Seem to be pulling the Most Current Data from Database (JSF, Hibernate)
indexed buttons
How do I access my field data?
[struts 2] Use Javascript confirm() dialog