This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
When user will enter value in the text field and press submit button, it will call Test servlet. Now you want the value entered in textfield by user in servlet so there you use getParameter method.
String lFirstName = request.getParameter("FIRSTNAME"); (This you will write in your servlet)
This method is responsible to take values from prevoius page to the forwarded page. Using this method you can retrive only one value. This method i.e. getParameter method is in ServletRequest interface which is part of javax.servlet package.
(2) getAttribute :
You want to take values from database in servlet and display them in jsp. Now you have resultset filled with data ready in servlet then you use getAttribute method and send this resultset to jsp where it can extracted and result is shown to the user.
in servlet -->
ResultSet lResultSet = // code to get data. request.getAttribute("EMPDATA",lResultSet);