SlideShare a Scribd company logo
1 of 3
Download to read offline
creating dynamic web project in eclipse
1.) create Survey servlet class and update code with below class code
2) update web.xml with below content
3) create register,html file
//Survey servlet class
import java.io.*;
import javax.servlet.ServletException;
import javax.servlet.http.*;
public class Survey extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//setting content type
response.setContentType("text/html");
//getting printwrite object
PrintWriter out = response.getWriter();
// accessing Form values from request
String firstName=request.getParameter("fName");
String lastName=request.getParameter("lName");
String emaiId=request.getParameter("userEmail");
String dob=request.getParameter("dob");
//printing values
out.println("Thanks for completing our Customer Survey form!");
out.println("The data you entered was: First name:"+firstName+"Last
name:"+lastName+"Email address:"+emailId+"Birth date:"+dob);
//closing connection out object
out.close();
}
}
//register.html
FirstName:
LatName:
Email Id:
Date of Birth:
//web.xml
SurveySurveySurvey/servlet/Registerregister.html
Solution
creating dynamic web project in eclipse
1.) create Survey servlet class and update code with below class code
2) update web.xml with below content
3) create register,html file
//Survey servlet class
import java.io.*;
import javax.servlet.ServletException;
import javax.servlet.http.*;
public class Survey extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//setting content type
response.setContentType("text/html");
//getting printwrite object
PrintWriter out = response.getWriter();
// accessing Form values from request
String firstName=request.getParameter("fName");
String lastName=request.getParameter("lName");
String emaiId=request.getParameter("userEmail");
String dob=request.getParameter("dob");
//printing values
out.println("Thanks for completing our Customer Survey form!");
out.println("The data you entered was: First name:"+firstName+"Last
name:"+lastName+"Email address:"+emailId+"Birth date:"+dob);
//closing connection out object
out.close();
}
}
//register.html
FirstName:
LatName:
Email Id:
Date of Birth:
//web.xml
SurveySurveySurvey/servlet/Registerregister.html

More Related Content

Similar to creating dynamic web project in eclipse1.) create Survey servlet c.pdf

Java Advance 4deleteQuery.PNGJava Advance 4deleteQuerySucc.docx
Java Advance 4deleteQuery.PNGJava Advance 4deleteQuerySucc.docxJava Advance 4deleteQuery.PNGJava Advance 4deleteQuerySucc.docx
Java Advance 4deleteQuery.PNGJava Advance 4deleteQuerySucc.docx
priestmanmable
 
I really need help on this question.Create a program that allows t.pdf
I really need help on this question.Create a program that allows t.pdfI really need help on this question.Create a program that allows t.pdf
I really need help on this question.Create a program that allows t.pdf
amitbagga0808
 
Ajax Fundamentals Web Applications
Ajax Fundamentals Web ApplicationsAjax Fundamentals Web Applications
Ajax Fundamentals Web Applications
dominion
 
Spring 3: What's New
Spring 3: What's NewSpring 3: What's New
Spring 3: What's New
Ted Pennings
 
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Anna Shymchenko
 
Javascript Frameworks for Joomla
Javascript Frameworks for JoomlaJavascript Frameworks for Joomla
Javascript Frameworks for Joomla
Luke Summerfield
 
JavaScript Lessons 2023 V2
JavaScript Lessons 2023 V2JavaScript Lessons 2023 V2
JavaScript Lessons 2023 V2
Laurence Svekis ✔
 

Similar to creating dynamic web project in eclipse1.) create Survey servlet c.pdf (20)

AJAX
AJAXAJAX
AJAX
 
AJAX
AJAXAJAX
AJAX
 
Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web Framework
 
Java Advance 4deleteQuery.PNGJava Advance 4deleteQuerySucc.docx
Java Advance 4deleteQuery.PNGJava Advance 4deleteQuerySucc.docxJava Advance 4deleteQuery.PNGJava Advance 4deleteQuerySucc.docx
Java Advance 4deleteQuery.PNGJava Advance 4deleteQuerySucc.docx
 
I really need help on this question.Create a program that allows t.pdf
I really need help on this question.Create a program that allows t.pdfI really need help on this question.Create a program that allows t.pdf
I really need help on this question.Create a program that allows t.pdf
 
Ajax Fundamentals Web Applications
Ajax Fundamentals Web ApplicationsAjax Fundamentals Web Applications
Ajax Fundamentals Web Applications
 
jQuery - Chapter 5 - Ajax
jQuery - Chapter 5 -  AjaxjQuery - Chapter 5 -  Ajax
jQuery - Chapter 5 - Ajax
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
 
Nestjs MasterClass Slides
Nestjs MasterClass SlidesNestjs MasterClass Slides
Nestjs MasterClass Slides
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Spring 3: What's New
Spring 3: What's NewSpring 3: What's New
Spring 3: What's New
 
Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6
 
Ejb3 Dan Hinojosa
Ejb3 Dan HinojosaEjb3 Dan Hinojosa
Ejb3 Dan Hinojosa
 
Servlets
ServletsServlets
Servlets
 
CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2
 
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
 
Android dev 3
Android dev 3Android dev 3
Android dev 3
 
Codemotion appengine
Codemotion appengineCodemotion appengine
Codemotion appengine
 
Javascript Frameworks for Joomla
Javascript Frameworks for JoomlaJavascript Frameworks for Joomla
Javascript Frameworks for Joomla
 
JavaScript Lessons 2023 V2
JavaScript Lessons 2023 V2JavaScript Lessons 2023 V2
JavaScript Lessons 2023 V2
 

More from asif1401

#includeiostream#includestdlib.husing namespace std;class .pdf
#includeiostream#includestdlib.husing namespace std;class .pdf#includeiostream#includestdlib.husing namespace std;class .pdf
#includeiostream#includestdlib.husing namespace std;class .pdf
asif1401
 
(1) Acid rain occurs when the gases SO2 ,NOx react with water,oxygen.pdf
(1) Acid rain occurs when the gases SO2 ,NOx react with water,oxygen.pdf(1) Acid rain occurs when the gases SO2 ,NOx react with water,oxygen.pdf
(1) Acid rain occurs when the gases SO2 ,NOx react with water,oxygen.pdf
asif1401
 
The main class of the tictoe game looks like.public class Main {.pdf
The main class of the tictoe game looks like.public class Main {.pdfThe main class of the tictoe game looks like.public class Main {.pdf
The main class of the tictoe game looks like.public class Main {.pdf
asif1401
 
QuestionAnswer1TrueThe corpus callosum , otherwise called th.pdf
QuestionAnswer1TrueThe corpus callosum , otherwise called th.pdfQuestionAnswer1TrueThe corpus callosum , otherwise called th.pdf
QuestionAnswer1TrueThe corpus callosum , otherwise called th.pdf
asif1401
 

More from asif1401 (20)

the reaction of A to B since its Ea is the highes.pdf
                     the reaction of A to B since its Ea is the highes.pdf                     the reaction of A to B since its Ea is the highes.pdf
the reaction of A to B since its Ea is the highes.pdf
 
the one thing that comes to mind for me is about .pdf
                     the one thing that comes to mind for me is about .pdf                     the one thing that comes to mind for me is about .pdf
the one thing that comes to mind for me is about .pdf
 
#includeiostream#includestdlib.husing namespace std;class .pdf
#includeiostream#includestdlib.husing namespace std;class .pdf#includeiostream#includestdlib.husing namespace std;class .pdf
#includeiostream#includestdlib.husing namespace std;class .pdf
 
(1) Acid rain occurs when the gases SO2 ,NOx react with water,oxygen.pdf
(1) Acid rain occurs when the gases SO2 ,NOx react with water,oxygen.pdf(1) Acid rain occurs when the gases SO2 ,NOx react with water,oxygen.pdf
(1) Acid rain occurs when the gases SO2 ,NOx react with water,oxygen.pdf
 
Iodine will replace both Cl and Br It will be SN2.pdf
                     Iodine will replace both Cl and Br It will be SN2.pdf                     Iodine will replace both Cl and Br It will be SN2.pdf
Iodine will replace both Cl and Br It will be SN2.pdf
 
The number of outcomes in the event A is 4 Yes event A is a s.pdf
 The number of outcomes in the event A is 4 Yes event A is a s.pdf The number of outcomes in the event A is 4 Yes event A is a s.pdf
The number of outcomes in the event A is 4 Yes event A is a s.pdf
 
There were very few planetary leftovers in this r.pdf
                     There were very few planetary leftovers in this r.pdf                     There were very few planetary leftovers in this r.pdf
There were very few planetary leftovers in this r.pdf
 
i have no idea. im just seeing if i get karma p.pdf
                     i have no idea. im just seeing if i get karma p.pdf                     i have no idea. im just seeing if i get karma p.pdf
i have no idea. im just seeing if i get karma p.pdf
 
Fe+3 solution is more acidic because it produces .pdf
                     Fe+3 solution is more acidic because it produces .pdf                     Fe+3 solution is more acidic because it produces .pdf
Fe+3 solution is more acidic because it produces .pdf
 
Copper chloride. Copper ions will form precipitat.pdf
                     Copper chloride. Copper ions will form precipitat.pdf                     Copper chloride. Copper ions will form precipitat.pdf
Copper chloride. Copper ions will form precipitat.pdf
 
   CCl4 molecule can give IR and Raman spectroscopy.   Selection r.pdf
   CCl4 molecule can give IR and Raman spectroscopy.   Selection r.pdf   CCl4 molecule can give IR and Raman spectroscopy.   Selection r.pdf
   CCl4 molecule can give IR and Raman spectroscopy.   Selection r.pdf
 
User interface design processNavigation DesignInput DesignOu.pdf
User interface design processNavigation DesignInput DesignOu.pdfUser interface design processNavigation DesignInput DesignOu.pdf
User interface design processNavigation DesignInput DesignOu.pdf
 
True.it  is an example of an independent-measures designSolution.pdf
True.it  is an example of an independent-measures designSolution.pdfTrue.it  is an example of an independent-measures designSolution.pdf
True.it  is an example of an independent-measures designSolution.pdf
 
The main class of the tictoe game looks like.public class Main {.pdf
The main class of the tictoe game looks like.public class Main {.pdfThe main class of the tictoe game looks like.public class Main {.pdf
The main class of the tictoe game looks like.public class Main {.pdf
 
the inner electronsSolutionthe inner electrons.pdf
the inner electronsSolutionthe inner electrons.pdfthe inner electronsSolutionthe inner electrons.pdf
the inner electronsSolutionthe inner electrons.pdf
 
SolutionThe investees net income should be recorded as an increa.pdf
SolutionThe investees net income should be recorded as an increa.pdfSolutionThe investees net income should be recorded as an increa.pdf
SolutionThe investees net income should be recorded as an increa.pdf
 
QuestionAnswer1TrueThe corpus callosum , otherwise called th.pdf
QuestionAnswer1TrueThe corpus callosum , otherwise called th.pdfQuestionAnswer1TrueThe corpus callosum , otherwise called th.pdf
QuestionAnswer1TrueThe corpus callosum , otherwise called th.pdf
 
No. of Moles = Given MassMolecular Mass=3.0 x 101398= 3.06101.pdf
No. of Moles = Given MassMolecular Mass=3.0 x 101398= 3.06101.pdfNo. of Moles = Given MassMolecular Mass=3.0 x 101398= 3.06101.pdf
No. of Moles = Given MassMolecular Mass=3.0 x 101398= 3.06101.pdf
 
Let the sample size be n ,Mean of the sample = 27 (same as pop.pdf
Let the sample size be n ,Mean of the sample = 27 (same as pop.pdfLet the sample size be n ,Mean of the sample = 27 (same as pop.pdf
Let the sample size be n ,Mean of the sample = 27 (same as pop.pdf
 
JeffSolutionJeff.pdf
JeffSolutionJeff.pdfJeffSolutionJeff.pdf
JeffSolutionJeff.pdf
 

Recently uploaded

Recently uploaded (20)

OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint
 
Scopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS PublicationsScopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS Publications
 
Climbers and Creepers used in landscaping
Climbers and Creepers used in landscapingClimbers and Creepers used in landscaping
Climbers and Creepers used in landscaping
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 

creating dynamic web project in eclipse1.) create Survey servlet c.pdf

  • 1. creating dynamic web project in eclipse 1.) create Survey servlet class and update code with below class code 2) update web.xml with below content 3) create register,html file //Survey servlet class import java.io.*; import javax.servlet.ServletException; import javax.servlet.http.*; public class Survey extends HttpServlet { public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //setting content type response.setContentType("text/html"); //getting printwrite object PrintWriter out = response.getWriter(); // accessing Form values from request String firstName=request.getParameter("fName"); String lastName=request.getParameter("lName"); String emaiId=request.getParameter("userEmail"); String dob=request.getParameter("dob"); //printing values out.println("Thanks for completing our Customer Survey form!"); out.println("The data you entered was: First name:"+firstName+"Last name:"+lastName+"Email address:"+emailId+"Birth date:"+dob); //closing connection out object out.close(); } } //register.html FirstName:
  • 2. LatName: Email Id: Date of Birth: //web.xml SurveySurveySurvey/servlet/Registerregister.html Solution creating dynamic web project in eclipse 1.) create Survey servlet class and update code with below class code 2) update web.xml with below content 3) create register,html file //Survey servlet class import java.io.*; import javax.servlet.ServletException; import javax.servlet.http.*; public class Survey extends HttpServlet { public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //setting content type response.setContentType("text/html"); //getting printwrite object PrintWriter out = response.getWriter(); // accessing Form values from request String firstName=request.getParameter("fName"); String lastName=request.getParameter("lName"); String emaiId=request.getParameter("userEmail"); String dob=request.getParameter("dob");
  • 3. //printing values out.println("Thanks for completing our Customer Survey form!"); out.println("The data you entered was: First name:"+firstName+"Last name:"+lastName+"Email address:"+emailId+"Birth date:"+dob); //closing connection out object out.close(); } } //register.html FirstName: LatName: Email Id: Date of Birth: //web.xml SurveySurveySurvey/servlet/Registerregister.html