Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

request.getParameter() not working

 
sony sa
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i am using the following code



next,first,last,previous are buttons on my form.
and on all the button clicks i am calling one javascript function as follows:


but the navigation is not working properly.
for the first time the default record is coming, but when i click
any button of above mentioned the last record is only coming,
as in the coding it is the first condition to be checked

can anyone help in this matter
i dont know exactly where i am going wrong

thanks
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just remove all the else from your scriplet then you will get only the first record

because i think none of your buttons are null.
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am I right in thinking that irs is a JDBC ResultSet? Does the i mean it's an instance variable? If so, are you sure it's not a FORWARD_ONLY ResultSet (the default). If it is then you can't go backwards. That may be your problem.

Jules
 
sony sa
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have code like this



its working properly for first and last
but not for next and previous
thanks
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not very clear from the code you've given what might be going wrong. For example, do your debug prints come out in the response to indicate the correct statement block was entered? What happens if you click the last button and then the first button? Have you tested Adeel's hypothesis that the button parameters are never null? Are you sure that the names on your form buttons are actually what you think they are?

Jules
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic