This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi I have a jsp in which there is a textbox, what i wanted to do is after posting the data i want a redirection happening in and string in ADD(please refer the below code) to be in the empty text box in page 1, the problem i'm facing is there is a query in first page which is making this textbox empty. i heard that i can take use of QueryString() or please suggest me any other process if available, but i'm not sure of how to use it. the redirection code is as below.
What does your first page look like?? Can you post the code of your JSP page containing the textbox you are displaying value in?
*PS: - Ideally, it is a very bad practice to code so much of Business logic (That too containing database talk) in your JSP..
Your JSP should just do the task of displaying the data, rest of the business logic should go into a controller (A Servlet)
Joined: Jul 16, 2012
the above is code of a servlet. and the jsp i used is as follows.
String s="Users.jsp?tgt1="+Add+"";(i wanted to know what should go here)
I'm not sure what you are looking for here, but would create a URN with a query string parameter named tgt1 with the value of Add appended.
In the context of your coding style your JSP would have and your input would be
Comments: You have two inputs outside your form in your JSP. One has
indicating you do have your database code in your JSP. And based on this