is This possible - request.getParameter(xx);
Hi,
I got a parameter which changes all the time (in my jsp) as follows
e.gparam1_12-1_value and next time it will be param1_13-2_value
the middle part changes
I have a request.getParameter("xxxx"); in my server side code.
Is it possible to have regular expression for xxxx?
What is the best way to handle this.
The parameter got a patern, hence I thought should be handled by regular expression.
Waiting for a reply
[473 byte] By [
lalith123a] at [2007-11-27 11:37:24]

# 2
You can use HttpServletRequest#getParameterNames() to retrieve all parameter names. Just loop through those names and look for matches. You can use String#matches() with regexp, but if the prefix and suffix of the name are always identical, then you can also consider String#startsWith() and String#endsWith(), which are slightly faster than using regexps.
# 3
Hi,
I know all of these are possible, but I thought without introducing for loops or iterators whether it is possible to get it first time by use of a reqx expression,
This is a very common requirement, I do not like to loop through unnecessarily.
Thanks,