aspose file tools*
The moose likes Servlets and the fly likes request.getOptionValueCount() problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "request.getOptionValueCount() problem" Watch "request.getOptionValueCount() problem" New topic
Author

request.getOptionValueCount() problem

Gary Damschen
Greenhorn

Joined: Sep 06, 2001
Posts: 1
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

Joined: Jul 26, 2001
Posts: 60
i couldnt find the above method....but whats wrong with request.getParameter("Amount")?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15661
    
  15

... Which will return null if the parameter value was not passed in from the client.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: request.getOptionValueCount() problem
 
Similar Threads
Passed
Passed
Error when string is passed from JSP
Snow is for the weak!
Passed (81%) & My Notes