Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet is not working properly

 
Efekodo Kingsley
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please need help dealling with this problem.i have a Controll servlet that user id from a jsp page.the id is used to delete user data from a database and when i run my jsp page,the servlet does not use the id to delete user data from the database.i can figure what the problem could be.thanks for your usual attension
the jsp code

the servlet code

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no idea if this is related to your immediate problem, but your use of instance variables:


to hold user request specific data is bound to cause trouble eventually since any number of request threads could be executing the servlet code "at the same time."

Bill
 
srinivas srinivasmeenavalli
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Issue would be using
request.getParameter("id")
. Id returns more than one record.
You may have to use .Try to print "id" value before using.
 
Mohamed Inayath
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
srinivas srinivasmeenavalli wrote:Issue would be using
request.getParameter("id")
. Id returns more than one record.
You may have to use .Try to print "id" value before using.


Its a radio button option any point time it will hold only one value.


Efekodo Kingsley, You are using Database connection within JSP its not a good practice.
JSP is for rendering views, you do retrieving of data in servlet and then use it in JSP.

Between are you getting any errors?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic