• Post Reply Bookmark Topic Watch Topic
  • New Topic

request.getOptionValueCount() problem

 
Gary Damschen
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I understand it, request.getOptionValueCount(paramName) can be used to determine whether or not a particular name-value pair has been passed to a jsp page. I am having a problem with the following piece of code that seems to work everywhere but on one particular page:
if (request.getOptionValueCount("amount") > 0)
{
// do something useful with request.amount
}
When I access the page I get the following error:
A problem occurred while processing this page. The error message is:
Javascript Error: ReferenceError: amount is not defined
lib/payment/cc_payment_info.js(Line 112)
Line 112 is the request.getOptionValue() line. I expected the server to skip the amount code section if there was no amount parameter passed into the page or amount= was passed in. Any suggestions re:what is causing the problem or how to work around it?
 
Manjunath Reddy
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i couldnt find the above method....but whats wrong with request.getParameter("Amount")?
 
Tim Holloway
Bartender
Posts: 18469
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... Which will return null if the parameter value was not passed in from the client.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!