JSP - How To Edit Table of Data Displayed Using JSP When Clicked On Edit Button

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

8/27/13

jsp :how to edit table of data displayed using jsp when clicked on edit button
Latest Tutorials | Questions and Answers | Ask Questions? | Site Map

Home

Java

Frameworks

Database

Technology

Web Development

Build/Test Tools

Servers

PHP

Home

Answers

Viewqa

JSP-Interview-Questions

jsp :how to edit table of data displayed using jsp when clicked on edit button

Login Search

Question
Posted in : JSP-Interview Questions

Ask Questions?

jsp :how to edit table of data displayed using jsp when clicked on edit button 4 Answer(s) a year and 3 months ago shruthi

Latest

Framew orks

Category

j av a based question Struts2 and Hibernate i w ant to create an application w ith only a button w hich on click displays table from database using struts2 and hibernate on eclipse array of string Scanner proj ect Spring framew ork Struts2 and Hibernate Struts2 and Hibernate

i have a jsp program which displays data in the form of table ..now i want to edit this information in table when clicked on edit button and save the data when clicked on save button.. how can i do this
Advertisement

Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

691
Follow

j sp code

Have Programming Question? Ask it here!

View Answers
May 15, 2012 at 2:13 PM

The given code retrieve data from database and display in the html table. At each row, there is a button which consists of that particular id. When the user clicks the particular edit button, that data will get shown in another page and allow the user to update the record. 1)application.jsp: < % @p a g ei m p o r t = " j a v a . s q l . * "% > < h t m l > < h e a d > < s c r i p tl a n g u a g e = " j a v a s c r i p t " > f u n c t i o ne d i t R e c o r d ( i d ) { v a rf = d o c u m e n t . f o r m ; f . m e t h o d = " p o s t " ; f . a c t i o n = ' e d i t . j s p ? i d = ' + i d ; f . s u b m i t ( ) ; } < / s c r i p t > < / h e a d > < b o d y > < b r > < b r > < f o r mm e t h o d = " p o s t "n a m e = " f o r m " > < t a b l eb o r d e r = " 1 " > < t r > < t h > N a m e < / t h > < t h > A d d r e s s < / t h > < t h > C o n t a c tN o < / t h > < t h > E m a i l < / t h > < / t r > < % C o n n e c t i o nc o n=n u l l ; S t r i n gu r l=" j d b c : m y s q l : / / l o c a l h o s t : 3 3 0 6 / " ; S t r i n gd b=" t e s t " ; S t r i n gd r i v e r=" c o m . m y s q l . j d b c . D r i v e r " ; S t r i n gu s e r N a m e= " r o o t " ;

www.roseindia.net/answers/viewqa/JSP-Interview-Questions/25903-jsp-how-to-edit-table-of-data-displayed-using-jsp-when-clicked-on-edit-button.html

1/8

8/27/13
S t r i n gp a s s w o r d = " r o o t " ;

jsp :how to edit table of data displayed using jsp when clicked on edit button

i n ts u m c o u n t = 0 ; S t a t e m e n ts t ; t r y { C l a s s . f o r N a m e ( d r i v e r ) . n e w I n s t a n c e ( ) ; c o n=D r i v e r M a n a g e r . g e t C o n n e c t i o n ( u r l + d b , u s e r N a m e , p a s s w o r d ) ; S t r i n gq u e r y=" s e l e c t*f r o me m p l o y e e " ; s t=c o n . c r e a t e S t a t e m e n t ( ) ; R e s u l t S e tr s=s t . e x e c u t e Q u e r y ( q u e r y ) ; % > < % w h i l e ( r s . n e x t ( ) ) { % > < t r > < t d > < % = r s . g e t S t r i n g ( 2 ) % > < / t d > < t d > < % = r s . g e t S t r i n g ( 3 ) % > < / t d > < t d > < % = r s . g e t S t r i n g ( 4 ) % > < / t d > < t d > < % = r s . g e t S t r i n g ( 5 ) % > < / t d > < t d > < i n p u tt y p e = " b u t t o n "n a m e = " e d i t "v a l u e = " E d i t "s t y l e = " b a c k g r o u n d c o l o r : g r e e n ; f o n t w e i g h t : b o l d ; c o l o r : w h i t e ; "o n c l i c k = " e d i t R e c o r d ( < % = r s . g e t S t r i n g < / t r > < % } % > < % } c a t c h ( E x c e p t i o ne ) { e . p r i n t S t a c k T r a c e ( ) ; } % > < / t a b l e > < / f o r m > < / b o d y > < / h t m l >

May 15, 2012 at 2:14 PM

continue.. 2)edit.jsp: < % @ p a g el a n g u a g e = " j a v a " % > < % @ p a g ei m p o r t = " j a v a . s q l . * " % > < f o r mm e t h o d = " p o s t "a c t i o n = " u p d a t e . j s p " > < t a b l eb o r d e r = " 1 " > < t r > < t h > N a m e < / t h > < t h > A d d r e s s < / t h > < t h > C o n t a c tN o < / t h > < t h > E m a i l < / t h > < / t r > < % S t r i n gi d = r e q u e s t . g e t P a r a m e t e r ( " i d " ) ; i n tn o = I n t e g e r . p a r s e I n t ( i d ) ; i n ts u m c o u n t = 0 ; t r y{ C l a s s . f o r N a m e ( " c o m . m y s q l . j d b c . D r i v e r " ) . n e w I n s t a n c e ( ) ; C o n n e c t i o nc o n n=D r i v e r M a n a g e r . g e t C o n n e c t i o n ( " j d b c : m y s q l : / / l o c a l h o s t : 3 3 0 6 / t e s t " ," r o o t " ," r o o t " ) ; S t r i n gq u e r y=" s e l e c t*f r o me m p l o y e ew h e r ei d = ' " + n o + " ' " ; S t a t e m e n ts t=c o n n . c r e a t e S t a t e m e n t ( ) ; R e s u l t S e tr s=s t . e x e c u t e Q u e r y ( q u e r y ) ; w h i l e ( r s . n e x t ( ) ) { % > < t r > < t d > < i n p u tt y p e = " t e x t "n a m e = " n a m e "v a l u e = " < % = r s . g e t S t r i n g ( " n a m e " ) % > " > < / t d > < t d > < i n p u tt y p e = " t e x t "n a m e = " a d d r e s s "v a l u e = " < % = r s . g e t S t r i n g ( " a d d r e s s " ) % > " > < / t d > < t d > < i n p u tt y p e = " t e x t "n a m e = " c o n t a c t "v a l u e = " < % = r s . g e t I n t ( " c o n t a c t N o " ) % > " > < / t d > < t d > < i n p u tt y p e = " t e x t "n a m e = " e m a i l "v a l u e = " < % = r s . g e t S t r i n g ( " e m a i l " ) % > " > < / t d > < t d > < i n p u tt y p e = " h i d d e n "n a m e = " i d "v a l u e = " < % = r s . g e t S t r i n g ( 1 ) % > " > < / t d > < / t r > < t r > < t d > < i n p u tt y p e = " s u b m i t "n a m e = " S u b m i t "v a l u e = " U p d a t e "s t y l e = " b a c k g r o u n d c o l o r : # 4 9 7 4 3 D ; f o n t w e i g h t : b o l d ; c o l o r : # f f f f f f ; " > < / t d > < / t r > < % } } c a t c h ( E x c e p t i o ne ) { } % > < / t a b l e > < / f o r m >

3)update.jsp: < % @ p a g ei m p o r t = " j a v a . s q l . * " % > < % S t r i n gi d e = r e q u e s t . g e t P a r a m e t e r ( " i d " ) ;

www.roseindia.net/answers/viewqa/JSP-Interview-Questions/25903-jsp-how-to-edit-table-of-data-displayed-using-jsp-when-clicked-on-edit-button.html

2/8

8/27/13

jsp :how to edit table of data displayed using jsp when clicked on edit button

i n tn u m = I n t e g e r . p a r s e I n t ( i d e ) ; S t r i n gn a m e = r e q u e s t . g e t P a r a m e t e r ( " n a m e " ) ; S t r i n ga d d r e s s = r e q u e s t . g e t P a r a m e t e r ( " a d d r e s s " ) ; i n tc o n t a c t = I n t e g e r . p a r s e I n t ( r e q u e s t . g e t P a r a m e t e r ( " c o n t a c t " ) ) ; S t r i n ge m a i l = r e q u e s t . g e t P a r a m e t e r ( " e m a i l " ) ; t r y { C o n n e c t i o nc o n n=n u l l ; C l a s s . f o r N a m e ( " c o m . m y s q l . j d b c . D r i v e r " ) . n e w I n s t a n c e ( ) ; c o n n=D r i v e r M a n a g e r . g e t C o n n e c t i o n ( " j d b c : m y s q l : / / l o c a l h o s t : 3 3 0 6 / t e s t " , " r o o t " ," r o o t " ) ; S t a t e m e n ts t = n u l l ; s t = c o n n . c r e a t e S t a t e m e n t ( ) ; s t . e x e c u t e U p d a t e ( " u p d a t ee m p l o y e es e tn a m e = ' " + n a m e + " ' , a d d r e s s = ' " + a d d r e s s + " ' , c o n t a c t N o = " + c o n t a c t + " , e m a i l = ' " + e m a i l + " 'w h e r ei d = ' " + n u m + " ' " ) ; r e s p o n s e . s e n d R e d i r e c t ( " / e x a m p l e s / j s p / a p p l i c a t i o n . j s p " ) ; } c a t c h ( E x c e p t i o ne ) { S y s t e m . o u t . p r i n t l n ( e ) ; } % >

May 15, 2012 at 6:49 PM

My database is xml..How can i do the same thing when database is xml..

August 23, 2012 at 11:21 AM

Application is working fine ... but the movement i click on edit button its not displaying any values .. wat might be the prob .. ? reply soon

Post Answer

JDBC API Download Java Script Java

Java JSP Edit XML

Preview:

JavaScript Core Java Tutorial Edit Editing

Post Answer

Related Pages:
jsp :how to edit table of data displayed using jsp when clicked on edit button jsp :how to edit table of data displayed using jsp when clicked on edit button i have a jsp program which displays data in the form of table ..now i... the data when clicked on save button.. how can i do

jsp :how to edit table of data displayed using jsp when clicked on edit button jsp :how to edit table of data displayed using jsp when clicked on edit... want to edit this information in table when clicked on edit button and save the data when clicked on save button.. how can i do this The given

www.roseindia.net/answers/viewqa/JSP-Interview-Questions/25903-jsp-how-to-edit-table-of-data-displayed-using-jsp-when-clicked-on-edit-button.html

3/8

8/27/13

jsp :how to edit table of data displayed using jsp when clicked on edit button

Update / Edit data field that i have prepared under the submit button. btw, im using jsp. thank you... consists of that particular id. When the user clicks the particular edit button... user data in the data base. the thing is, when i click on submit reference

Advertisement

Edit the record. Edit the record. sir, I have a table consist of huge data.I have displayed that data.side of them there is an edit button which will edit that particular record.after editing the data i want to edit another row which is next

Drop down and radio button value on edit action Drop down and radio button value on edit action HI, I have... the value from dropdown and radio button.. But the problem goes with edit action.. While the edit form is being displayed it gets all the values from the database

extract data fom table when a button is clicked in front end page using mysql5.0 and tomcat6.0 extract data fom table when a button is clicked in front end page using mysql5.0 and tomcat6.0 sir, i want to extract data from table which is stored in mysql5.0 databse, when a button is clicked in front end page using

uitableview edit done button call, when Edit / done Button is clicked. In that case you need not to write...uitableview edit done button How to add Edit / Done button in UITableView with an action on click? UITableview Edit done Button To add

edit data edit data sir i want to do edit a particular customers information after he logs in, i am also using sessions. thank you

delete and edit options in struts delete and edit options in struts Hi, I am doing an web application using struts, jsp, tomcat server, oracle as a database in netbeans IDE 7.1.2, I... errors but the edit and delete operations were not working, so please modify my

delete and edit options in struts delete and edit options in struts Hi, I am doing an web application using struts, jsp, tomcat server, oracle as a database in netbeans IDE 7.1.2, I... errors but the edit and delete operations were not working, so please modify my

delete and edit options in struts delete and edit options in struts Hi, I am doing an web application using struts, jsp, tomcat server, oracle as a database in netbeans IDE 7.1.2, I... errors but the edit and delete operations were not working, so please modify my

delete and edit options in struts delete and edit options in struts Hi, I am doing an web application using struts, jsp, tomcat server, oracle as a database in netbeans IDE 7.1.2, I... errors but the edit and delete operations were not

www.roseindia.net/answers/viewqa/JSP-Interview-Questions/25903-jsp-how-to-edit-table-of-data-displayed-using-jsp-when-clicked-on-edit-button.html

4/8

8/27/13
working, so please modify my

jsp :how to edit table of data displayed using jsp when clicked on edit button

delete and edit options in struts delete and edit options in struts Hi, I am doing an web application using struts, jsp, tomcat server, oracle as a database in netbeans IDE 7.1.2, I... errors but the edit and delete operations were not working, so please modify my

delete and edit options in struts delete and edit options in struts Hi, I am doing an web application using struts, jsp, tomcat server, oracle as a database in netbeans IDE 7.1.2, I... errors but the edit and delete operations were not working, so please modify my

delete and edit options in struts delete and edit options in struts Hi, I am doing an web application using struts, jsp, tomcat server, oracle as a database in netbeans IDE 7.1.2, I... errors but the edit and delete operations were not working, so please modify my

delete and edit options in struts delete and edit options in struts Hi, I am doing an web application using struts, jsp, tomcat server, oracle as a database in netbeans IDE 7.1.2, I... errors but the edit and delete operations were not working, so please modify my

delete and edit options in struts delete and edit options in struts Hi, I am doing an web application using struts, jsp, tomcat server, oracle as a database in netbeans IDE 7.1.2, I... errors but the edit and delete operations were not working, so please modify my

delete and edit options in struts delete and edit options in struts Hi, I am doing an web application using struts, jsp, tomcat server, oracle as a database in netbeans IDE 7.1.2, I... errors but the edit and delete operations were not working, so please modify my

delete and edit options in struts delete and edit options in struts Hi, I am doing an web application using struts, jsp, tomcat server, oracle as a database in netbeans IDE 7.1.2, I... errors but the edit and delete operations were not working, so please modify my

insert , edit , and delete button in one jsp page insert , edit , and delete button in one jsp page hello I want to ask about the way of creating a jsp page contains insert , edit , and delete buttons and manipulate data in database directly. any help please or hints

radio button value on edit action radio button value on edit action This is my edit.jsp code...In my......Problem 'm facing is on edit action 'm not retrieving radio button value..i have...="cancel" class="button" onclick="return f2(edit_customer)"> <

Delete and edit data in xml file using JSP Delete and edit data in xml file using JSP I want to know how to delete and edit data from an XML file by use of JSP. I have XML file having tasks... in the xml file,I want to delete and edit some tasks using task id then how can i do

Edit Distance Edit Distance I want java programming ask from user input two string and the program find the edit distance between two strings and find table and optimal solution using GUI

Add Edit And Delete Employee Information Add Edit and Delete Employee Information Using Swing ..., edit and delete the Employee's information from the database using java swing... enters the id and click the edit button, the information of the particular

get a value when a radio button clicked - JSP-Servlet get a value when a radio button clicked sorry sir my actual probs is that 1st i m callig a jsp in that i m displaying a table where i used a radio button to access a value(also used u r code),then in this jsp i

www.roseindia.net/answers/viewqa/JSP-Interview-Questions/25903-jsp-how-to-edit-table-of-data-displayed-using-jsp-when-clicked-on-edit-button.html

5/8

8/27/13
m having a forms

jsp :how to edit table of data displayed using jsp when clicked on edit button

edit values of database using jsp edit values of database using jsp hi i want a code to edit the row from tye database and display in a page which containd radio buttons and drop down boxes using jsp code

edit values of database using jsp edit values of database using jsp hi i want a code to edit the row from tye database and display in a page which containd radio buttons and drop down boxes using jsp code

How to edit values in textboxes from database using jsp How to edit values in textboxes from database using jsp Hi RoseIndia, I need help to solve my technical problem, i want to edit values in textboxes from database table using jsp, here is my code Please can anyone help me

JSP Servlet Search and Edit - JSP-Servlet to the following jsp. Also, when I use it for a character column, if the backend table ...JSP Servlet Search and Edit Hi, I want to thank the people who... Post). The code works fine when I've incorporated it in my web application, its

sorting and filtering the displayed table data using jsp and xml sorting and filtering the displayed table data using jsp and xml I have created a xml file and a jsp file, which uses DOM parser to display... that is displayed in web page. How to do it ??? Please help as soon as possible

UINavigationBar Edit Button UINavigationBar Edit Button UINavigationBar Edit Button Given is the code that adds a edit button item as a nav bar item in your UINavigation Controller. -(void)viewDidLoad; { [super viewDidLoad]; UINavigationBar* navBar

data grid with edit and delete options at each row. data grid with edit and delete options at each row. i want to display the table data in the format of data grid with edit and delete options at each row. i need it very urgently. advance thanks

Displaying image when clicked on URL in jsp - JSP-Servlet Displaying image when clicked on URL in jsp Hi, I am using... For Screenshot : abc.jpg here abc.jpg is a url and when clicked would show me an image... *.jpg images displayed depending upon the page url clicked. Please guide me

Delete and add row from Table View iPhone to delete and also how to add row into the table view iPhone, with the help of edit button on navigation bar. When we press Edit button it will show you ADD... the variable for the table and the action for the Edit button which is present

JSP - Update displayed content & session variables when user clicks on a button - JSP-Servlet JSP - Update displayed content & session variables when user clicks... on certain buttons (say an img of a "+" sign). When the user does that, I would like JSP to do some internal check and then increment the value of a number

Dojo Inline Edit Box Dojo Inline Edit Box In this section, you will learn how to edit any data ... the role as a <div> tag when not in edit mode. When you click widget text

create,edit and delete in JSP using struts and SQL server2005 as database in jdeveloper? create,edit and delete in JSP using struts and SQL server2005 as database in jdeveloper? I have a project ie create an application for users to create,edit and delete tasks: taskid, taskname, date, project in JSP and struts

get a value when a radio button clicked - JSP-Servlet get a value when a radio button clicked Here is my code sir please help me if any changes in the code please give me sir thanks in advance...; //System.out.println("******* id in jsp login Is ******" +id); f.submit

www.roseindia.net/answers/viewqa/JSP-Interview-Questions/25903-jsp-how-to-edit-table-of-data-displayed-using-jsp-when-clicked-on-edit-button.html

6/8

8/27/13

jsp :how to edit table of data displayed using jsp when clicked on edit button

create,edit and delete in JSP using struts and SQL server2005 as database in jdeveloper? create,edit and delete in JSP using struts and SQL server2005 as database... to create,edit and delete tasks: taskid, taskname, date, project in JSP and struts... example using struts.if anyone knows how to do it..please help me.. thanks a lot

Non-edit Combobox with auto fill - Swing AWT Non-edit Combobox with auto fill Hi, I have a non-edit... typed by the user. For example, ["Callisto", "Charls", "chim"] are the data in JCombobox model. When user type 'C', JCombobox selects "Callisto

data update data update sir, I have a table consist of huge data.I have displayed that data in table format be side of a table an edit button which will edit... the data and edit it based on subjectcode(varchar)this should be done using jsp

data update data update sir, I have a table consist of huge data.I have displayed that data in table format be side of a table an edit button which will edit... the data and edit it based on subjectcode(varchar)this should be done using jsp

data update data update sir, I have a table consist of huge data.I have displayed that data in table format be side of a table an edit button which will edit... the data and edit it based on subjectcode(varchar)this should be done using jsp

data update data update sir, I have a table consist of huge data.I have displayed that data in table format be side of a table an edit button which will edit... the data and edit it based on subjectcode(varchar)this should be done using jsp

data update data update sir, I have a table consist of huge data.I have displayed that data in table format be side of a table an edit button which will edit... the data and edit it based on subjectcode(varchar)this should be done using jsp

data update data update sir, I have a table consist of huge data.I have displayed that data in table format be side of a table an edit button which will edit... the data and edit it based on subjectcode(varchar)this should be done using jsp

data update data update sir, I have a table consist of huge data.I have displayed that data in table format be side of a table an edit button which will edit... the data and edit it based on subjectcode(varchar)this should be done using jsp

data update displayed that data in table format be side of a table an edit button which will edit... the data and edit it based on subjectcode(varchar)this should be done using jsp... edit/update data and saved them into that table again

How to save image after edit in php How to save image after edit in php Hello, I have create a simple... successfully but i don't know how to replace orignal image with the effects. please...;body> <form name="form1" action="index.php" enctype="multipart/form-data

Login Box appears when a button on the webpage is clicked Login Box appears when a button on the webpage is clicked How to create a Login Box on a web page that appears only when a button that is already present on the page is clicked

Services
Software Solutions
JSF Development

Website Development
Web Designing

Web Promotion Services

Content Development
Content Development

Web Hosting Services


ASP.NET Hosting

E-Commerce Solutions
CRM

www.roseindia.net/answers/viewqa/JSP-Interview-Questions/25903-jsp-how-to-edit-table-of-data-displayed-using-jsp-when-clicked-on-edit-button.html

7/8

8/27/13
Outsourcing ERP M-Commerce Flex Development Web Redesigning Web Development Logo Design Web Design Packages Domain Registration

jsp :how to edit table of data displayed using jsp when clicked on edit button
SEO Services Search Eng. Optimization Search Eng. Submission SEO Tips SEO Portfolio Web Promotion Plans Article Writing Blog Writing New s Writing SEO Copyw riting Technical Documentation Article Marketing Unix Hosting E-Commerce Hosting Window s Hosting Hosting Plan

Home

Privacy Policy

All Rights are Reserved for Rose India

www.roseindia.net/answers/viewqa/JSP-Interview-Questions/25903-jsp-how-to-edit-table-of-data-displayed-using-jsp-when-clicked-on-edit-button.html

8/8

You might also like